Repository navigation
fix(test): synchronize custom worker shutdown proof - #132824
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 29, 2026, 4:41 PM ET / 20:41 UTC. ClawSweeper reviewWhat this changesThe PR records custom-worker readiness only after the parent delivers Vitest’s stopped response, then asserts that ordering in the shutdown regression. Regression provenancePossible regression — probable (reviewed change; failure trace). No predecessor PR is attributed. Merge readinessThe narrowed test-only repair is source-aligned with Vitest’s custom-worker shutdown contract and has no actionable review finding; keep it open for normal maintainer handling while exact-head checks complete. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw’s test tooling launches Vitest worker pools and records lifecycle events to prove safe shutdown behavior. This fixture models a custom worker and feeds its stop acknowledgment into the parent-side shutdown assertions. flowchart LR
A[Custom test worker] --> B[Stopped IPC response]
B --> C[Parent process wrapper]
C --> D[Vitest stopped listener]
D --> E[Readiness marker]
E --> F[Shutdown assertions]
Before merge
Agent review detailsSecurityNone. PR surfaceTests +11. Total +11 across 2 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Land the parent-consumption ordering assertion after the required checks are green, retaining the existing custom-worker parent-owned shutdown protocol. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: current main’s custom fixture writes readiness from the child send callback before parent message consumption, while the focused shutdown scenario exercises that deadline ordering. The read-only review did not execute the fixture. Is this the best way to solve the issue? Yes. Moving the marker to immediately after parent-side synchronous emission records the fact the deadline depends on, and the added assertion protects that precise ordering without weakening timeouts or changing production code. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against f9b3bcccdba3. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (2 earlier review cycles)
|
d0de9ff to
9e2a8f5
Compare
|
@clawsweeper re-review The head now fixes the exact-head custom-pool teardown race by marking fixture readiness only after the parent has synchronously delivered Vitest's |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
9e2a8f5 to
e5fa6d1
Compare
|
@clawsweeper re-review The branch was refreshed onto |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Related: #132784
What Problem This Solves
Exact-head Node 24/Linux CI exposed a race in the intentional custom-pool shutdown proof. The custom worker wrote the fixture's
readymarker from the child IPC send callback. That callback confirms the message was sent, but not that Vitest's parent-sidestoppedlistener consumed it.The parent preload could therefore observe
readyand invoke the captured 60-second stop deadline before Vitest processed the response, producing[vitest-pool-runner]: Timeout waiting for worker to respondduring an otherwise successful custom-worker teardown.Why This Change Was Made
For the non-opt-in custom worker, the child now sends
stoppedwithout owning readiness. The parentChildProcesswrapper first delivers the message through the existing synchronous Vitest listeners, then recordsstopped-consumedand writesready.The regression test requires that consumed-response event while preserving the existing exit-0, parent-stop, SIGTERM, no-deadline, cleanup, signal, and caller assertions.
PR #132820 independently landed the native worker profiling repair and fully absorbed this PR's original unsupported-profiler routing work. After refreshing onto current
main, this branch retains only the distinct custom-worker synchronization fix.User Impact
Maintainers get deterministic Node 24/Linux shutdown coverage for custom pools without relaxing the exit assertion, extending timeouts, or changing production behavior. This removes the CI blocker for #132784.
Evidence
33272396917:custom/rawraced the captured stop deadline before Vitest consumedstopped, causing a teardown timeout at the exit-0 assertion.Testbox run:
ClawSweeper Rank-up Moves
Provenance
The shutdown matrix landed in
0f2211294740cf855c64f09cc73bb45ce7cf0964(#132403). Exact-head CI later exposed the custom-worker message-consumption race. PR #132820 landed the overlapping profiler-routing repair before this branch refreshed ontomain.