Repository navigation
fix(test): join tsx fixture children before cleanup - #132808
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 29, 2026, 5:28 PM ET / 21:28 UTC. ClawSweeper reviewWhat this changesThe PR makes tsx wrapper fixtures await callback work and managed Node commands before cleanup, preserving failure output when teardown cannot be verified. Regression provenancePossible regression — probable (reviewed change; known regression link). No predecessor PR is attributed. Merge readinessKeep open for maintainer review. Current main still has the synchronous fixture cleanup this PR repairs, and no introduced correctness defect was found; exact-head CI is still incomplete. Priority: P3 Review scores
Verification
How this fits togetherThe direct-run test fixture creates a temporary checkout and starts Node/tsx wrapper processes. Its managed-command helper terminates and joins child processes before the fixture removes temporary files. flowchart LR
A[Fixture callback] --> B[Temporary checkout]
B --> C[Node and tsx wrapper]
C --> D[Managed command]
D --> E[Child teardown and output]
E --> F[Fixture cleanup]
Decision needed
Why: The patch is source-consistent and the item carries the maintainer label, so final merge acceptance requires maintainer judgment after CI resolves. Before merge
Agent review detailsSecurityNone. PR surfaceTests +267. Total +267 across 4 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the single managed-command ownership path and land only after the exact head’s relevant CI completes successfully. Do we have a high-confidence way to reproduce the issue? Yes, source provides a high-confidence path: current main deletes the fixture immediately after a synchronous callback, while the new timeout test holds a descendant command across callback rejection. Is this the best way to solve the issue? Yes. Reusing the existing managed-command owner centralizes subprocess teardown and output capture instead of adding another child-process policy path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 8ca8fe255697. 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
History |
a938555 to
b0354de
Compare
|
Maintainer acceptance is complete for the fixture-owner repair at Local macOS Node 24.20.0 proof: 113 passed, one Linux-only skip: node scripts/run-vitest.mjs test/scripts/direct-run-entrypoints.test.ts test/helpers/run-node-script.test.ts test/helpers/bounded-child-output.test.ts test/scripts/managed-child-process.test.ts test/scripts/vitest-fork-shutdown.test.tsChanged-file gates, root test types, direct type-aware lint, formatting, and whitespace checks passed. Fresh isolated Codex autoreview of the full branch diff is clean at its default P0 scope. Native review artifacts validate with zero findings. The latest ClawSweeper rank-up move to complete exact-head CI is satisfied. The independent shutdown-profile repair #132820 is already in the base. Both task commits remain patch-equivalent: exactly four test/support files, +355/-88 (net +267), production +0/-0. Original 10,000 ms budgets and existing assertions are preserved. The original Windows timeout cause remains unknown; no tsx cache regression or causal cache fix is claimed. Proceeding through native prepare and merge with all server gates intact. |
|
Merged via squash.
|
* fix(test): join tsx fixture children before cleanup * test: verify fixture retention at command settlement
Related: #132713 — paired-Mac catalog repair whose broad fallback CI exposed this independent test-fixture weakness.
What Problem This Solves
Resolves a problem where a timed-out tsx wrapper fixture could delete its temporary checkout without owning descendant teardown, and the failing assertion discarded captured stdout/stderr. This is a maintainer-requested test-infrastructure repair, not a production cache change.
The original Windows job hit the unchanged 10-second
spawnSyncdeadline at head6ae2b5a8df4a0d9872c622b053f42619e3486ad6. It actually ran Windows 2025 and Node 22.23.2. Its unchanged-code rerun passed. Neither result establishes the initial timeout cause or a tsx cache regression.Why This Change Was Made
The fixture now awaits its callback and every registered command through the existing
runNodeScript/runManagedCommandownership path before deletion. Unconfirmed cleanup retains the original fixture and bounded command output, with an explicit recovery path. POSIX fixtures sit outside the outer Vitest disposable namespace and outside repository module resolution; Windows keeps the ordinary temporary root.The shared test runner gains argv/cwd support rather than duplicating subprocess capture or process-tree policy. Its bounded output callback now explicitly declares its existing receiver-independent
this: voidcontract. Production runtime, tsx/esbuild dependencies, worker settings, and cache policy are unchanged. Increasing timeouts or disabling esbuild workers would not repair fixture ownership and was deliberately avoided.User Impact
No product behavior change. Developers get managed timeout teardown and useful failure diagnostics without changing the 10,000 ms command budget. All existing cache sentinels and scan guard, environment preservation, transformed snapshots, preload/fork behavior, exit-17 assertions, and failure-trailer assertions remain intact.
Production LOC: +0/-0. Tests and test support: +355/-88 (net +267), including the extracted fixture setup and five failure/lifecycle cases. No configuration, schema, persistence, package, or public API surface changes.
Evidence
false, expectedtrue), including the platform-neutral assertion added for Windows. Independent PID-based recovery prevents the regression proof from relying on the broken fixture for cleanup.git diff --checkpassed. Fresh isolated Codex autoreview found no actionable findings at its default P0 scope.Commands:
Pre-rebase Windows proof passed at
a938555a9c0347f41bfebd6a6aaac6f5977842b4, run 33271666117, attempt 1: test-1 and test-2. The actual runner was Blacksmith Windows 2025 with Node 22.23.2. The inspected test-1 log confirms both original cache cases and all five lifecycle/failure cases passed, including the real descendant timeout with the platform-neutral ordering assertion (10,122 ms). Both Windows jobs also passed the initial repair head. The assertion-only follow-up was revalidated locally (52 tests, root test types, direct lint, and fresh isolated autoreview all passed).The previous aggregate CI failure was isolated to the untouched Linux shutdown fixture. The canonical repair landed separately in #132820 at
f9b3bcccdba3dc159c6484c30f56974b90a6d938, switching that fixture to native worker CPU/heap profiles. This branch was mechanically rebased onto that repair; it does not duplicate or modify it. Range-diff confirms both original commits are patch-equivalent and the delta remains the same four test/support files (+355/-88; production +0/-0).Fresh post-rebase local proof on macOS Node 24.20.0 passed 113 tests with one Linux-only skip, including all 12 canonical shutdown-fixture cases and the real descendant timeout (10,767 ms). Root test types, direct type-aware lint, changed-file gates, formatting, and whitespace checks passed. A fresh isolated Codex autoreview of the complete branch diff found no actionable findings at its default P0 scope. No source edits, timeout increases, assertion weakening, or production changes were made during landing recovery.
The focused command above is the final five-file recovery command. The original Windows timeout cause remains unknown; this PR repairs fixture ownership and diagnostics, not an established tsx cache regression.
Final exact-head CI is green at
b0354de3e6462136d160f69b9d67bf4786ad6203: run 33275896095, attempt 1, and aggregate gate 99163257204. Both Windows test-1 and Windows test-2 passed. The inspected Windows 2025 / Node 22.23.2 test-1 log confirms all 46 direct-run cases passed, including both cache cases, all five lifecycle cases, and the real descendant timeout with fixture-presence-at-settlement proof (10,117 ms). The normal exact-head watcher finishedGREEN; no CI retry or bypass was needed.The latest ClawSweeper review, reviewed at 21:28 UTC on this exact head, has no code findings. Its rank-up move to complete required exact-head CI is now satisfied. Native review artifacts are complete and validated. The maintainer has reviewed the complete evidence and accepted this fixture-owner repair for landing through the native workflow.
AI-assisted; implementation and evidence independently reviewed.