* fix(#969): make bug-969 hardening tests hermetic and move build tsbuildinfo out of shipped tree (regression from #996) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(#969): self-heal legacy bin-local tsbuildinfo and make sentinel test hermetic (adversarial-review follow-ups) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * chore(changeset): set pr number to 1002 * docs(#1001): record DEFECT.SHARED-ARTIFACT-MUTATION-IN-CONCURRENT-TEST anti-pattern in CONTEXT.md --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1.9 KiB
1.9 KiB
Summary
next is currently red across the full-test matrix (macOS 22/24, Windows 22) and the ubuntu-24 coverage leg. Root-caused to commit 88e30d53 (PR #996, which closed #969 "fix stale-build flake"). The commit right before it (d617735b) was green.
Root cause
#996 did two things that interact badly with the concurrent node --test runner:
- Added
tests/bug-969-test-infra-flake-hardening.test.cjswhose two destructive testsfs.unlinkSyncthe real sharedgsd-core/bin/lib/core.cjs(and the real build tsbuildinfo) mid-run, rebuilding/restoring infinally. Becausenode --testruns files concurrently, any other test thatrequirescore.cjsduring that window fails withCannot find module .../gsd-core/bin/lib/core.cjs. This is a textbook real-race test (forbidden byRULESET.TESTS.delete-bad-tests). - Set
tsBuildInfoFile: "gsd-core/bin/tsconfig.build.tsbuildinfo"— placing mutable build state insidegsd-core/bin/, a directory install tests copy recursively viafs.cpSync. A concurrent rebuild writing/unlinking that file races the copy →copyfile ENOENT.
Symptom: ~40–50 tests fail per leg with MODULE_NOT_FOUND/ENOENT; leg-asymmetric (timing-sensitive). Reproduced locally on the first iteration of running the bug-969 test concurrently with state.test.cjs + install.test.cjs.
Impact
next red ⇒ branch protection blocks all PRs from merging (Required tests fails).
Fix (fix-forward)
- Make the two destructive
bug-969tests hermetic — exercise a parameterizedensureBuiltArtifacts(overrides)against a throwaway temp TS project; never touch realgsd-core/bin/lib. - Move
tsconfig.build.tsbuildinfoout ofgsd-core/bin/to the repo root (gitignored); self-heal stale bin-local copies on persistent workspaces.
Verification
- 10× concurrent race check clean (was iter-1 repro before).
- Full unit suite: 4775 pass / 0 fail through the modified runner.