Repository navigation
fix(test): preserve shard crash exit codes and failure reports - #134688
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Land-ready proof for The historical false-success signal branch was already removed by #133309 and #132716. This change fixes the remaining producer mismatch: the shard completion adapter used 143 for every signal. It now reuses The new native-process matrix failed three report-code assertions before the change (143 versus 134/137) and all seven cases passed afterward. With existing serial/parallel success, ordinary failure, and cancellation coverage, 15 focused cases passed: node scripts/run-vitest.mjs test/scripts/vitest-report-owner.test.ts -t 'preserves shard crashes|retains the exact case union.*serial|retains the exact case union.*parallel|publishes complete evidence.*failure|never publishes incomplete.*cancel'
node scripts/check-changed.mjs -- scripts/test-projects.mts test/scripts/vitest-report-fixture.ts test/scripts/vitest-report-owner.test.tsA separate real V8 heap exhaustion at the shard process boundary ( Changed-file checks passed on Blacksmith Testbox Limits: POSIX signal cases are skipped on Windows. This is wrapper evidence and reporting repair, not a fix for command-suite heap retention. The sibling plugin-batch numeric report-code inconsistency is recorded in the PR body as a separate follow-up. |
|
Codex review: needs maintainer review before merge. Reviewed August 31, 2026, 11:11 PM ET / September 1, 2026, 03:11 UTC. ClawSweeper reviewWhat this changesThe branch preserves each crashed Vitest shard’s actual signal-derived exit code in test-runner failure output and retained report metadata. Regression provenancePossible regression — probable (reviewed change; failure trace). No predecessor PR is attributed. Merge readiness✅ Ready for maintainer review The patch is correct and remains necessary: current main still hard-codes 143 for all shard signals. It is maintainer-labeled work, so it should stay open for normal maintainer handling. Priority: P2 Review scores
Verification
How this fits togetherThe test project runner launches Vitest shards and passes outcomes to the scheduler, failure digest, and optional retained reports. This change normalizes signal termination before those consumers record the outcome. flowchart LR
A[Vitest shard] --> B[Process completion]
B --> C[Signal normalization]
C --> D[Test scheduler]
C --> E[Failure digest]
C --> F[Retained report set]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +39, Other 0. Total +39 across 3 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Land the boundary-level normalization and its real-process regression matrix, while tracking the pre-existing plugin-batch report-code mismatch separately under its own owner and coverage. Do we have a high-confidence way to reproduce the issue? Yes—source establishes the incorrect 143 fallback on current main, and the PR supplies a real-child crash matrix that exercises the affected project-runner paths. Is this the best way to solve the issue? Yes—the canonical signal helper is applied at the single completion boundary before scheduling, reporting, and trailer consumers diverge. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against a0868f477a8e. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
What Problem This Solves
Resolves a problem where a Vitest shard killed by SIGABRT or SIGKILL was recorded as exit 143 in the test wrapper's failure digest and retained report index.
This follows a report that an OOM during
pnpm test src/commandsprintedpassed 2 Vitest shardsand exited zero. Current main already removed that historical signal-loss path in #133309 and #132716. This PR corrects the remaining result mismatch and adds real-process regression coverage for the original false-success contract.Why This Change Was Made
Normalize the effective forwarded or child signal once at the shard completion boundary using the existing
signalExitCodehelper. The scheduler, report owner, and failure digest now receive the same nonzero signal-derived code. Ordinary numeric exits retain their existing behavior.Production/tooling LOC: +6/-6. Test and fixture LOC: +40/-1. No new production API, option, dependency, or fallback.
User Impact
Test-wrapper failure evidence accurately records SIGABRT as 134 and SIGKILL as 137. Regression tests require both serial and parallel crashes to fail, omit a passing summary, and end with a failure trailer through the project runner and JavaScript wrapper.
Evidence
node scripts/run-vitest.mjs test/scripts/vitest-report-owner.test.ts -t 'preserves shard crashes|retains the exact case union.*serial|retains the exact case union.*parallel|publishes complete evidence.*failure|never publishes incomplete.*cancel'--max-old-space-size=16exhausted its heap during thesrc/commandsrunner flow. The fatal V8 OOM remained visible; the runner exited 134 and its final stderr line was[test] FAILED (exit 134).git diff --checkpassed. Changed-file validation passed on Blacksmith Testboxtbx_01m1de6770rh777tz9etkp3zks, Actions run 33464239543; the one-shot lease stopped successfully. Exact-head hosted CI 33464291816 passed at95bf5027ea570cb42425253f9c5ba77889290497.The crash tests use real Vitest processes and synthetic temporary configs, with no production test seam. POSIX signal assertions are skipped on Windows. This does not diagnose or fix the original command-suite heap growth.
Follow-up identified during sibling inspection: the plugin batch runner separately records
code ?? 1for signaled report outcomes. Its owner still propagates termination and rejects incomplete reports; normalizing those report codes belongs with its own batch/trailer coverage.