Repository navigation
fix(diagnostics): preserve graceful Gateway shutdown in install E2E - #139247
Conversation
Observe process close under the existing test lifetime instead of invoking the five-second forced reaper as the graceful-shutdown assertion path. Keep exact exit and signal assertions, forced teardown, and install/metrics coverage. Retain termination state and post-stop Gateway logs on failure. Follow up the graceful-shutdown coverage added in #138249.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 5, 2026, 2:20 PM ET / 18:20 UTC. ClawSweeper reviewWhat this changesUpdates the Prometheus installation test to await graceful Gateway shutdown within the existing test deadline and include termination details and logs on failure. Merge readiness✅ Ready for maintainer review No actionable findings. This remains a useful, focused repair: current main still races graceful shutdown against forced cleanup, and the supplied evidence covers successful shutdown and rejection of SIGKILL. Priority: P2 Review scores
Verification
How this fits togetherThe Prometheus installation test installs a packaged plugin, starts a real Gateway, and checks authenticated metrics. Its shutdown assertion verifies clean termination before fixture cleanup removes child processes and temporary files. flowchart TD
A[Packaged Prometheus plugin] --> B[Managed installation]
B --> C[Real Gateway]
C --> D[Authenticated metrics checks]
D --> E[SIGTERM and close observer]
E --> F[Clean exit assertion]
E --> G[Failure details and logs]
F --> H[Forced cleanup if needed]
G --> H
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +18. Total +18 across 1 file. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep graceful-exit verification separate from emergency cleanup, with cancellation bounded by the existing test lifetime and production shutdown policy unchanged. Do we have a high-confidence way to reproduce the issue? Yes, from source: a Gateway draining longer than five seconds is forcibly killed by the existing assertion path. The supplied body reports that failure; this review did not execute it. Is this the best way to solve the issue? Yes. Correcting the test's use of the emergency reaper addresses the owning mistake; enlarging the shared cleanup timeout or changing Gateway startup policy would affect unrelated behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 64c543a78b7f. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
* commit '911d7d5b0c107f7274f2415ca9655dcc6105f0e8': (867 commits) fix(skills): deliver pending Workshop approval controls (#139248) fix(gateway): deliver loopback ask_user prompts to the originating channel (#138831) docs: keep root agent instructions focused on repository policy (#139258) fix(matrix): exclude archived state roots from scans and selection (#112329) perf(agents): prepare exact tool names once per catalog batch (#139267) fix: preserve Swarm progress and simplify owner plumbing (#139269) fix(tailscale): release claims after gateway process-group exit (#139261) refactor(cli): simplify lazy command registration (#139108) test(ui): retain synthetic widget failure evidence (#139229) fix(buzz): keep implicit replies at thread root (#138879) test(diagnostics): await graceful Gateway shutdown before cleanup (#139247) fix(ci): unblock releases with different tooling package managers (#139259) feat(ui): add social preview links for private sessions (#139250) fix(codex): retain failed conversations for guarded continuation (#139246) chore(ui): refresh control ui locales (#139200) fix(ci): run browser checks for real-gateway inputs (#139256) fix(llama-cpp): reconcile managed router state before requests (#136363) chore(i18n): refresh native locales (#139237) refactor(worker): unify inference payload handling (#139245) refactor(terminal): replay wrapped prefixes in one pass (#139240) ...
…enclaw#139247) Observe process close under the existing test lifetime instead of invoking the five-second forced reaper as the graceful-shutdown assertion path. Keep exact exit and signal assertions, forced teardown, and install/metrics coverage. Retain termination state and post-stop Gateway logs on failure. Follow up the graceful-shutdown coverage added in openclaw#138249.
Related: #138249
What Problem This Solves
The Prometheus managed-install E2E sometimes killed a healthy Gateway while it drained startup work, then failed its graceful-exit assertion. Its cleanup helper escalates to SIGKILL after five seconds; that emergency cleanup deadline is not the Gateway's graceful-shutdown contract.
Why This Change Was Made
Pre-arm the child close observer, bind it to Vitest's existing test timeout/cancellation signal, and send SIGTERM directly for the graceful-shutdown proof. Keep the exact exit-code-zero and null-signal assertions, all install/metrics checks, and the existing five-second forced reaper in
afterEach.Shutdown failures now include the captured exit code, signal, and bounded post-stop Gateway logs before fixture cleanup removes them. No test timeout, Gateway policy, or Control UI configuration changes.
User Impact
Maintainers retain meaningful graceful-shutdown coverage without racing an emergency reaper against legitimate startup work. Production behavior is unchanged. This main-only follow-up is separate from the frozen release candidate.
Evidence
null/SIGKILLwhile the Gateway drained startup work.startup:sidecars.control-ui-assets. The owner released naturally after its build, then the Gateway exited zero with no signal. This was not a product deadlock or a retrospective explanation of the original release-CI event.a3726dbf12396eb058dce8a2a37c102a73f5dfdf.Fresh ClawSweeper review found no actionable defects or before-merge actions. The real-flow evidence above was executed independently; ClawSweeper reviewed source and reported evidence without rerunning it.