Repository navigation
fix(test): preserve survivor probe stderr after process exit - #155220
Conversation
|
🦞👀 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 21, 2026, 5:59 PM ET / 21:59 UTC. ClawSweeper reviewWhat this changesThe probe test helper waits for child output streams to close before returning results, adds a real-process stderr regression, and strengthens invalid-input exit assertions. Merge readiness✅ Ready for maintainer review Keep open: this focused repair remains necessary on fetched main, and no actionable correctness or security findings were found. The deterministic regression addresses the reported output-drain race. Priority: P2 Review scores
Verification
How this fits togetherUpgrade-survivor tests launch a Gateway health-probe script and collect its exit status and diagnostic output. This change affects the test harness that reports those results, without changing the probe or installed updater. flowchart LR
A[Test arguments] --> B[Probe test helper]
B --> C[Real probe child]
C --> D[Exit status]
C --> E[Buffered diagnostic output]
D --> F[Wait for stream closure]
E --> F
F --> G[Result assertions]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +27. Total +27 across 1 file. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep output collection in the existing test helper and publish results only after its child streams finish draining. Do we have a high-confidence way to reproduce the issue? Yes: pausing the real probe child's stderr through exit exposes the collector's premature snapshot, and the captured validation reports the expected pre-fix failure. This review verified the source path without executing it. Is this the best way to solve the issue? Yes: close is the correct completion boundary for collected child output, and the regression preserves real process behavior without adding sleeps, retries, or production seams. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against bc41bb950b65. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
What Problem This Solves
Fixes upgrade-survivor probe tests intermittently losing child validation diagnostics on hosted runners. Run 35654149298, job 106514023806 failed on #154920 with empty stderr in
rejects loose numeric probe limits instead of parsing prefixes(core-tooling-7-hosted-2).User Impact
No production behavior changes. The test helper reliably returns complete probe output together with the child result; invalid-limit assertions also require exit code 1 without a signal or timeout error.
Why This Change Was Made
runProbe()captured stderr on the child process'sexitevent, before its output pipes were guaranteed to drain. Resolve oncloseinstead. The regression pauses the real probe child's stderr through the recordedexitevent, then resumes it and requires the complete diagnostic. It uses no delay or invented error output.The probe and original test blobs are identical between the failed merge's main parent (
6615891cc3650b2136fa25c136ac37c8dc111676) and this branch's starting main (de5312833912c9926a80835c25139feaa0511c64). Today's survivor changes did not touch this probe; #154861 changes diagnostic artifact collection.Evidence
tbx_01m32yckncrx90w3g3f8c7crdq, validation run, with the test and unchanged probe source hashes verified.exithandler deterministically failed withexpected '' to contain 'invalid --timeout-ms: 1e3', after recording exit code 1, no signal, and paused stderr. Restoringclosepassed.pnpm test test/scripts/upgrade-survivor-probe-gateway.test.ts --maxWorkers=1: 12 passed; 3.657 s command wall time, 2.41 s Vitest duration (88% test time). The new regression took 47 ms in the local focused run.node scripts/check-changed.mjs -- test/scripts/upgrade-survivor-probe-gateway.test.ts: passed, including root test typecheck, all dead-export scans, all script lint, and changed-test lint. The combined proof/check command exited 0 in 9m35s.git diff --checkpassed.Validation targets the real probe and its output-collection boundary; the original 82-file hosted shard was not replayed. Hosted PR CI timing is pending at authoring handoff.