Repository navigation
test: restore native worker shutdown profiling coverage - #132820
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:00 PM ET / 20:00 UTC. ClawSweeper reviewWhat this changesThe PR launches the shutdown fixture through the standard Vitest launcher with native worker profiling flags, then verifies CPU and heap artifacts belong to the worker that ran the test. Regression provenancePossible regression — probable (reviewed change; failure trace). No predecessor PR is attributed. Merge readinessKeep open. The introduced test-only change removes the fixture’s incompatible Inspector-profiler path for vmForks and custom graceful-exit coverage; no introduced correctness or security defect was found. The protected maintainer label means final merge handling remains with a maintainer. Priority: P2 Review scores
Verification
How this fits togetherThe shutdown fixture starts isolated Vitest worker pools and records their exit behavior, worker identity, and profiling artifacts. Its assertions protect the test-runner cleanup contract used by CI without changing application runtime behavior. flowchart LR
A[Shutdown scenarios] --> B[Fixture launcher]
B --> C[Vitest worker pool]
C --> D[Worker receipt]
C --> E[Native profile artifacts]
D --> F[Shutdown assertions]
E --> F
F --> G[CI regression coverage]
Before merge
Agent review detailsSecurityNone. PR surfaceTests +15. Total +15 across 2 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain this narrow test-boundary repair and merge only after exact-head CI and the latest ClawSweeper review requirements are confirmed. Do we have a high-confidence way to reproduce the issue? Yes, from source: vmForks reaches the Inspector runner’s explicit unsupported-pool rejection before the fixture receipt is written. The PR body also records a before/after run, but this read-only review did not execute the fixture. Is this the best way to solve the issue? Yes. The standard launcher already forwards worker arguments, while the specialized Inspector runner intentionally rejects vmForks; native worker flags test the exit-time artifact contract at the correct boundary without changing production profiling. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 8cd61f02bf48. LabelsLabel changes:
Label 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
|
|
ClawSweeper before-merge items dispositioned:
Also closed #132822, an independently-developed fix for this same breakage, in favor of this PR: it keeps profiling coverage for the affected scenarios instead of dropping those assertions, and additionally matches profile files by worker PID/threadId so a launcher profile cannot satisfy a worker exit-flush assertion. |
|
Merged via squash.
|
What Problem This Solves
Two shutdown regression cases fail on current main before their test body runs:
vmForksand the custom fork transport that opts into graceful exit. The fixture invokes the general profiling wrapper, which now uses an Inspector profiler restricted to forks and threads. Its startup error is then hidden by an unconditional read of the missing test receipt. This blocked unrelated Slack and E2E-runner CI on their merge refs.Why This Change Was Made
Run the shutdown fixture through the existing Vitest launcher and pass native CPU/heap profiling flags only through worker
execArgv. The dependency patch's contract is native exit-time flushing; testing it through the newer awaited Inspector profiler mixes two different owners. The production profiler and its supported-pool restrictions remain unchanged.Keep all twelve cases, existing deadlines, failure assertions, and cleanup checks. Match valid native profiles to the PID and thread ID recorded by the actual test worker, so a launcher profile cannot satisfy the proof. Missing receipts now report the captured child output instead of hiding the startup failure.
Evidence
86b9cf728895: baseline 10 passed, 2 failed, reproducing both CI failures. Captured child stderr confirms the unsupported-pool error before the missing receipt.execArgvforwarding for forks, threads, and vmForks.Production/runtime delta: 0. Tests and test support: +39/-24 (net +15). No dependency patch, product configuration, timeout, or profiler-policy change.
Provenance: the native shutdown fixture was introduced in #132403 (
0f221129474); the Inspector profiling implementation arrived in #132224 (81a74b23eb1). This repairs their combined test contract rather than reverting either owner.