test: fix Windows fixture lifetimes - #224
Conversation
Move the physical package copy into suite setup and drain tracked fixture operations before teardown. Preserve the child liveness deadline and all independent-package and lock-domain cleanup assertions. Split the ordered traversal and copy/move corpora into per-payload cases without changing their shared state or boundary checks. Add lifecycle regressions and a Windows proof that delays the real package copy past the ordinary test timeout.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed September 4, 2026, 5:34 AM ET / 09:34 UTC. ClawSweeper reviewWhat this changesThe PR moves slow shared test fixture setup into a separately timed lifecycle, drains pending filesystem work before cleanup, splits two adversarial corpora into per-payload tests, and adds a Windows slow-copy CI proof. Merge readiness✅ Ready for maintainer review Keep open: this focused repair remains necessary because current main retains the timeout-prone fixture shape; the branch adds a scoped lifecycle guard with exact-head Windows proof and no actionable defect found. Priority: P2 Review scores
Verification
How this fits togetherThe test suite creates temporary filesystem fixtures and runs built-package child processes to validate lock cleanup and path confinement. The new fixture lifecycle tracks setup and test work so teardown only removes directories after that work has settled, with Windows CI exercising the delayed-copy case. flowchart TD
A[Filesystem test suites] --> B[Shared fixture lifecycle]
B --> C[Prepare fixture work]
C --> D[Run ordered test cases]
D --> E[Drain pending work]
E --> F[Remove temporary directories]
F --> G[Windows slow-copy CI proof]
Before mergeNone. Agent review detailsSecurityNone. Review metrics
Technical reviewBest possible solution: Land the scoped fixture-lifecycle repair so Windows cleanup assertions remain deterministic without changing filesystem runtime behavior. Do we have a high-confidence way to reproduce the issue? Yes—source-reproducible: the reviewed slow-copy configuration defines the delayed package-copy scenario, and the supplied exact-head Windows runs report the repaired teardown behavior. Is this the best way to solve the issue? Yes. Tracking and draining the shared fixture's actual work before cleanup is the narrowest maintainable repair while retaining the child-process liveness limit and boundary assertions. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against dc6daf69ca00. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
Windows CI exposed two fixture-lifetime failures: recursively copying the built package consumed the process-exit test's five-second deadline, and large traversal/copy-move corpora shared one 30-second deadline. Vitest does not cancel timed-out filesystem promises, so teardown could remove directories while those operations were still running, producing
ENOTEMPTY.Move physical-package setup into a separately budgeted suite hook, and serialize/drain suite-owned work before removing its directories. Preserve the independent physical package import, all twelve manager domains, every lock-cleanup assertion, and the child's four-second liveness guard. Run all 96 traversal and 48 copy/move payloads in their original order with shared fixture state and a deadline per payload. Production code, permission checks, native boundaries, global test timeouts, and coverage thresholds are unchanged.
Validation:
CI=1 pnpm check,pnpm docs:site, andgit diff --checkpassed. The complete local fallback check passed 5,038 tests (2,427 platform/native-dependent cases skipped); hosted CI covers native and Windows paths.This is a focused follow-up to the postmerge Windows failures after #220. The earlier PowerShell permission-inspection timeout passed its retry; its production deadline and fail-closed behavior remain intact. No further blind retry was used for the known fixture failure.
Exact-head validation at
d263be6bc84eda96e6a84e34c7b3e87ac03ee9c3:teardownRacedCopy: false. Node 22's actual child case took 346 ms.Observed Windows proof (open step 7 in each linked job):
copied: true,teardownRacedCopy: false; test passed.copied: true,teardownRacedCopy: false; test passed.Both successful runs include the fixture-absence assertion after teardown, independent-package assertion, twelve lock-domain cleanup assertions, and unchanged four-second child deadline. These completed Windows logs supply the runtime evidence requested in the earlier automated review.
No failures or reruns on this repair candidate. Prepared for maintainer review; not merged.