Repository navigation
fix(test): let profiler help shut down naturally - #149010
Conversation
Return after awaited profile finalization so Node can drain normal shutdown work before exiting. Retain the finalization-stage diagnostics and verify beforeExit, profile counts, and managed child completion. Extract the focused profiler change from source commit 7016601 in #145335. Fresh Linux Node 24.19.0 runs preserve both nonreproductions of the intermittent CI stall; the beforeExit contract fails before this change and passes afterward. Co-authored-by: Jason (Json) <[email protected]>
|
🦞👀 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: blocked before merge. Reviewed September 15, 2026, 8:41 AM ET / 12:41 UTC (Revision 3). ClawSweeper reviewWhat this changesThe profiler help command finishes writing its profile and lets Node shut down naturally, with regression assertions for shutdown drainage and artifact counts. Merge readiness⛔ Blocked before merge - 1 item remains This remains a useful, focused repair: current main still forces help to exit, and no blocking patch defect was found. The maintainer-authored, protected PR is not a cleanup candidate. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw’s developer profiling wrapper launches Vitest in a managed child process and collects CPU or heap profiles. Help requests print usage and finalize any active capture before the parent observes completion. flowchart TD
A[Developer profiler command] --> B[Managed child process]
B --> C{Help requested?}
C -->|Yes| D[Print help and finalize capture]
D --> E[Node drains and exits]
E --> F[Parent observes completion]
C -->|No| G[Run and profile tests]
Before merge
Agent review detailsSecurityNone. PR surfaceTests +6, Other +5. Total +11 across 2 files. View PR surface stats
Review metricsNone. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the existing finalization and managed-process owners, allow natural help shutdown, and retain the separate native-stall investigation. Do we have a high-confidence way to reproduce the issue? Yes for skipped natural shutdown: current main explicitly calls process.exit, which bypasses beforeExit, and the PR reports four failing baseline assertions. No reliable reproduction of the intermittent native stall is established. Is this the best way to solve the issue? Yes for the bounded shutdown contract: returning after awaited finalization preserves existing owners and avoids forced termination without changing test execution or cleanup policy. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against c0be265998d0. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
|
Merged via squash.
|
Return after awaited profile finalization so Node can drain normal shutdown work before exiting. Retain the finalization-stage diagnostics and verify beforeExit, profile counts, and managed child completion. Extract the focused profiler change from source commit 7016601 in openclaw#145335. Fresh Linux Node 24.19.0 runs preserve both nonreproductions of the intermittent CI stall; the beforeExit contract fails before this change and passes afterward. Co-authored-by: Jason (Json) <[email protected]>
…tream profiler shutdown fixes openclaw#149010/openclaw#148804)
Related: #145335, #148825
What Problem This Solves
Profiler help forces process exit after writing its profile, skipping Node's normal shutdown drainage. CI has also observed help commands stall after finalization and an exit event, before the parent observes child completion.
User Impact
This affects internal developer tooling. Profiler help retains its output and profile artifacts while allowing normal shutdown work to finish.
Why This Change Was Made
Return from the asynchronous entrypoint after awaited profile finalization. Keep normal test execution, error handling, managed process cleanup, and the existing finalization-stage diagnostics intact. The help tests now require the child's
beforeExitevent and the expected profile count.This is a focused extraction of @fuller-stack-dev's profiler change from #145335, with the newer diagnostics preserved.
Evidence