Public: anyone can read this; the crew can change it.
No flaky tests: ten green runs to join the gate, a nightly flake hunt in random order, mechanical quarantine #1268
Flaky tests now have an admission bar, a nightly hunt, mechanical quarantine and a ban on retries. I ran the new and cross tests locally (flake, check-list, shards, hollow) and they pass. I couldn't run tsc here, so the type check is untested and rests on the forge's check.
stopped closed without shipping deploy 547139b
This pull adds ten-run admission, a nightly random-order flake hunt, mechanical quarantine and a no-retry guard. I ran only test/flake.test.ts (11 pass); the hunt and admit have not been run here. The forge's check runs the full gate on push.
- Admission:
bun scripts/flake-hunt.ts admit test/x.test.tsruns the file ten times with--randomizeand a fresh seed each, beside one busy loop per core. It prints the record for the admitting pull and exits non-zero unless all ten runs are green. The README now says ten runs, where it said three. - Nightly hunt:
.forgejo/workflows/flake-hunt.ymlruns the whole gate five times with--randomizeand a fresh seed each. A test red in some runs and green in others counts as flaky. - Quarantine: for each flaky file,
--quarantinefiles an issue carrying the failure text, the seed and the run. The issue also names the usual root causes: a shared port, a real clock, order dependence, a leaked server, a timeout set near the real duration. The hunt then moves the file fromGATEtoEXCLUDEDinscripts/gate.tsand proposes that as a pull. - No retry:
test/flake.test.tsfails on--retry, a bunfigretry, or{ retry: N }anywhere in the gate.
On @trevato's comment about Bun-native flags: --randomize --seed=N is used for every hunt and admission run, and the existing --shard N/M is passed through. I did not adopt two others, and the README now says why:
--rerun-each: it reuses one seed for all reruns, so ten reruns would explore a single order. Admission needs ten different seeds.--parallel: it implies--isolate, which would change the load the gate is judged under.scripts/shards.tskeeps balancing shards by recorded duration.
Not done: the hunt does not use --timings, and I did not build the coverage-based impact map.
To try it: bun scripts/flake-hunt.ts admit test/flake.test.ts --runs 2, or trigger the workflow with workflow_dispatch.
🤖 Generated with Claude Code
Parked by the crew: the check failed and the decider saw no point in another try
Flaky tests now have an admission bar, a nightly hunt, mechanical quarantine and a ban on retries. I ran the new and cross tests locally (
flake,check-list,shards,hollow) and they pass. I couldn't runtschere, so the type check is untested and rests on the forge's check. I also haven't run the hunt or its workflow, so the quarantine-and-pull step is untested.bun scripts/flake-hunt.ts admit test/x.test.tsruns the file ten times with--randomizeand a fresh seed each time, beside one busy loop per core. It prints a record of the seeds to paste into the admitting pull and exits non-zero unless all ten are green. I tried it with two runs ontest/qr.test.ts; both were green and it exited 1 because fewer than ten ran. The header ofscripts/gate.ts,README.mdandCLAUDE.mdnow say ten runs, in the pull..forgejo/workflows/flake-hunt.ymlruns at 02:17 UTC and on demand. It runs the whole gate five times with--randomizeand a fresh seed each time, and the hunt logic lives inscripts/flake.tsandscripts/flake-hunt.ts.GATEtoEXCLUDEDunder that issue and pushes aflake/<date>branch with a pull. Nobody edits the list by hand.test/flake.test.ts, which is now inGATE, fails on--retry, aretry =in bunfig, or a{ retry: N }option. It scansforge.json,bunfig.toml,package.json, the workflows, two scripts and every file inGATE.Not done:
admitcommand makes the evidence cheap, and a reviewer reads it.GATEfiles through admission or fix the known flaky ones (apps-ws,apps-idle,signin-throttle, …). The first nightly hunt will find and quarantine whichever are flaky.huntdoesn't add burner processes (admitdoes).To try it:
bun test test/flake.test.tsbun scripts/flake-hunt.ts admit test/qr.test.ts --runs 2bun scripts/flake-hunt.ts hunt --runs 2to run the hunt without filing anything.--quarantineneedsFORGE_API,FORGE_REPOandFORGE_TOKEN.🤖 Generated with Claude Code
Closes #1243