Repository navigation
fix(test): preserve failed shard diagnostics - #116289
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 30, 2026, 3:40 AM ET / 07:40 UTC. ClawSweeper reviewWhat this changesThis PR updates the Vitest project dispatcher so failed parallel shards can print their diagnostic summary and rerun commands before the command exits nonzero, with a regression guard against direct forced exits. Merge readinessThe patch is a focused, plausible repair for a maintainer test-runner failure: it lets Node finish writing failed-shard diagnostics while preserving the nonzero exit status. It should remain open because it is a current maintainer-authored PR with pending CI, not a cleanup-close candidate; I found no concrete defect in the proposed change. Priority: P3 Review scores
Verification
How this fits togetherThe Vitest project dispatcher expands requested test targets into child test runs, aggregates their exit results, and prints failure diagnostics for maintainers. Its final exit status is consumed by local test commands and CI after summaries and rerun instructions have been emitted. flowchart TD
A[Requested test targets] --> B[Vitest project dispatcher]
B --> C[Child shard runs]
C --> D[Aggregate failures and timings]
D --> E[Print failed-shard diagnostics]
E --> F[Release test lock]
F --> G[Nonzero command exit status]
Before merge
Agent review detailsSecurityNone. PR surfaceTests +6, Other +1. Total +7 across 2 files. View PR surface stats
Review metricsNone. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Rebase or refresh against current main, retain the deferred-exit behavior and regression guard, then land after the required checks confirm the exact head. Do we have a high-confidence way to reproduce the issue? No high-confidence independent live reproduction was established in this read-only review. The failure mechanism is source-reproducible, and the PR provides a concrete forced two-shard failure result plus focused-test evidence. Is this the best way to solve the issue? Yes. Setting process.exitCode after the script has emitted diagnostics is the narrow Node-compatible repair; retaining the explicit return in the serial non-continuation path preserves the existing stop-after-failure behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against c8f0db2c24eb. 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
HistoryReview history (1 earlier review cycle)
|
|
ClawSweeper rank-up moves addressed:
Focused tests, forced-failure diagnostics, Testbox changed gates, review artifacts, and autoreview are all clean. |
|
Merged via squash.
|
Related: #115696
What Problem This Solves
Fixes an issue where maintainers running parallel Vitest shards could lose the failed-shard digest and rerun commands when the dispatcher exited nonzero with buffered stderr.
Why This Change Was Made
The dispatcher now sets
process.exitCodeafter writing summaries instead of forcing immediate termination withprocess.exit(). A regression guard keeps direct forced exits out of this output-producing script.User Impact
Maintainers get the actual failed shard and focused rerun command after long parallel test runs instead of only a generic nonzero summary. No product runtime behavior changes.
Evidence
node scripts/run-vitest.mjs test/scripts/test-projects.test.ts: 256 tests passedAI-assisted: yes; maintainer reviewed the implementation and evidence.