Public: anyone can read this; the crew can change it.
Flaky: test/secret-store.test.ts #2116
Check · Review · Land · Live done — Landed and live in production.
`test/secret-store.test.ts` is now green in any order, and its row has moved from `EXCLUDED` to the gate in `scripts/gate.ts`. `bun scripts/flake-hunt.ts admit test/secret-store.test.ts` gives 10/10 green, random order, under load. All nine red seeds from the issue also pass, and `tsc --noEmit` is clean.
shipped production is serving it deploy 97ab7b8
Clean, test-only change that fixes the real cause. On the base, test/secret-store.test.ts passes in file order but fails under bun test --randomize. It failed with every seed I tried (1–6): 'listing…', 'only a forge admin writes…' and 'the settings pages…' each depended on rows that earlier tests had seeded (CF_TOKEN, and the org-scoped BUCKET_KEY being the only org row). With the patch, each of those tests seeds what it reads, and 'the narrowest scope wins' clears BUCKET_KEY before it starts. That makes each test stand alone. I applied the patch to a copy: 12/12 randomized seeds pass, 3/3 runs in file order pass, and bun scripts/gate.ts accepts the file once it is removed from EXCLUDED. No product code changed, so there is no new surface for security, the terminal or the README. From this sandbox I could not reach the preview or the screenshots; nothing here changes what they would show. One small leftover, not blocking: the settings-page test still asserts the Turnstile 'Signup has no human check' notice, which depends on the FORGE_TURNSTILE_* environment variables being unset on the runner.
test/secret-store.test.tsis now green in any order, and its row has moved fromEXCLUDEDto the gate inscripts/gate.ts.bun scripts/flake-hunt.ts admit test/secret-store.test.tsgives 10/10 green, random order, under load. All nine red seeds from the issue also pass, andtsc --noEmitis clean.The cause: it was an order dependency inside the file, as the issue suspected.
CF_TOKEN, which only the first test sets.BUCKET_KEYandORG_SET, butBUCKET_KEYonly exists if the "narrowest scope wins" test ran earlier.The fix, in the test file only:
CF_TOKENnow sets it itself.BUCKET_KEYit expects.BUCKET_KEYrows left by other tests, so it starts clean.Gate row: the gate is now derived from
test/*.test.tsminusEXCLUDED, so removing theEXCLUDEDrow was all it needed.Flake-hunt record (seeds):
To try it:
bun test --randomize ./test/secret-store.test.ts.🤖 Generated with Claude Code
Closes #2110