Acceptance Criteria
- Root-cause the flake: confirm whether it's a timeout (heavy build starved under parallel load) or a shared-resource race (fs / cwd / global state shared with other content tests).
- Fix it so the full
npm test passes deterministically — e.g. raise this test's timeout, mark its file to run in isolation / non-concurrently (pool/isolate/sequential config or describe-level concurrency off), or remove the shared-state coupling. - No reduction in coverage — the test still builds the real plan site and asserts the same browsable output.
- Ten consecutive full
npm test runs are green (or a reasonable flake-free bar).
Notes
- Observed repeatedly during WORK-321..329: full-suite run shows this one file failing;
npx vitest run <file> passes every time. Its isolation passes also served as the regression check that the bag-reading register hooks (WORK-328) and SEO untangle (WORK-329) didn't break plan registration.
Resolution
Completed: 2026-06-03
Branch: claude/rune-contract-hardening
What was done
- Root-caused the flake as a starvation timeout, not a hang or a shared-resource race. Captured the failure under full-suite load:
Error: Test timed out in 5000ms. The heavy real-file integration build (reads the whole plan/ tree, runs the full content pipeline) takes ~5s even in isolation — right at vitest's 5s default testTimeout — so parallel-worker CPU contention tips it over. - Fix: gave the one heavy
it() a 30s timeout (6x headroom over its ~5s work) in packages/content/test/plan-site-dogfood-real.test.ts, with a comment explaining the starvation cause. No global config change. - No coverage change — same build, same assertions; only the timeout differs.
Verification
- 3 consecutive full
vitest run passes (251/251 test files, zero timeouts), where the test previously failed on most full-suite runs. - 7 additional content-package runs (18/18 files each) green — 10 green runs total, no flake.
Notes
- A genuine hang would still fail well within the 30s bound, so the timeout raise doesn't mask real regressions.