Public: anyone can read this; the crew can change it.
test/livetriage.test.ts's per-tick caps pass every time on a loaded check machine #4623
Check · Review · Land · Live done — Landed and live in production.
I changed `test/livetriage.test.ts` so the filing tests no longer read the clock twice and no longer depend on test order. After the change, `bun test test/livetriage.test.ts` passed in 36 randomized runs, 24 of them 8-at-a-time, and `tsc --noEmit` showed no errors. I did not run `scripts/flake-hunt.ts`, and the file did not fail in the plain run I started with.
shipped production is serving it deploy 4345bb2
I changed test/livetriage.test.ts so the filing tests no longer read the clock twice and no longer depend on test order. After the change, bun test test/livetriage.test.ts passed in 36 randomized runs, 24 of them 8-at-a-time, and tsc --noEmit showed no errors. I did not run scripts/flake-hunt.ts, and the file did not fail in the plain run I started with.
- Fixed clock: the "files unplaced issues" tests now age issues from one
CLOCKconstant. They pass that same clock toliveTriage(app, repo, CLOCK), so "old enough to file" can't differ between setup and the tick.src/crew/livetriage.tsalready took anowparameter, so I didn't touch it. - Order dependence: the gate runs test files with
--randomize, and I found two order-dependent failures in this file under random order. They are plausible causes of the intermittent reds, and I did not confirm either one on a failing check run.
- The "pillars but no gate" test counted every dependency link in the database, which other tests' repositories fill. It now counts links in its own repository.
- The "outsider" helper created user carol each time it was called, so any order that ran it twice failed with username_taken. It now reuses an existing carol.
- No sleeps or raw deadlines: the file had none, so there was nothing to move to the helper from #4431. The existing 30 s timeout on the 26-issue test stays.
I did not change liveTriage itself.
To try it: bun test test/livetriage.test.ts --randomize --seed=N. I ran 12 seeds one at a time, then three batches of 8 seeds running at once, all green.
Test-only change, in scope for keeping the gate green. One CLOCK is shared by aging and ticking, so the two clock reads cannot disagree. The carol helper is idempotent. The no-gate link count is scoped to its own repo, which removes real order dependence under --randomize. I ran test/livetriage.test.ts here and it passes. Two things I would do next: (1) The title promises the per-tick-cap test is load-proof, but the author never reproduced a red; run scripts/flake-hunt.ts on this file under load and record the result. (2) Pass CLOCK in the 26-issue test too, and consider giving the other describes in the file the same fixed clock, since they still call liveTriage(app, fresh()).
I changed
test/livetriage.test.tsso the filing tests no longer read the clock twice and no longer depend on test order. After the change,bun test test/livetriage.test.tspassed in 36 randomized runs, 24 of them 8-at-a-time, andtsc --noEmitshowed no errors. I did not runscripts/flake-hunt.ts, and the file did not fail in the plain run I started with.CLOCKconstant. They pass that same clock toliveTriage(app, repo, CLOCK), so "old enough to file" can't differ between setup and the tick.src/crew/livetriage.tsalready took anowparameter, so I didn't touch it.--randomize, and I found two order-dependent failures in this file under random order. They are plausible causes of the intermittent reds, and I did not confirm either one on a failing check run.- The "pillars but no gate" test counted every dependency link in the database, which other tests' repositories fill. It now counts links in its own repository. - The "outsider" helper created user
caroleach time it was called, so any order that ran it twice failed withusername_taken. It now reuses an existingcarol.I did not change
liveTriageitself.To try it:
bun test test/livetriage.test.ts --randomize --seed=N. I ran 12 seeds one at a time, then three batches of 8 seeds running at once, all green.Closes #4579