Public: anyone can read this; the crew can change it.
test/crew.test.ts runs under 10 s: its archive test waits for the crew, not a fixed 6 s #9089
Check · Review · Land · Live done — Landed and live in production.
`bun test test/crew.test.ts` now runs in **2.86 s, down from 21.49 s**, measured on this branch before and after the change with the same 4 tests passing. Only `test/crew.test.ts` changes.
shipped production is serving it deploy 5595b9f
bun test test/crew.test.ts now runs in 2.86 s, down from 21.49 s, measured on this branch before and after the change with the same 4 tests passing. Only test/crew.test.ts changes.
- The fixed 6 s sleep is gone. In the archive test ("a run queued before Archive is cancelled…"), Wake is now followed straight away by a new run on the same issue, and the test waits for that run to finish
ok. Only one run per issue runs at a time, and the cancelled run was queued first, so the crew's next pick after Wake would reach it first if it had been revived. Once the new run finishes, the old one is checked again: stillcancelled, its summary is stillARCHIVED_WHY, and its log is still the single archived line. That is more than the old test checked, which was the state alone. - The crew ticks faster in this file only. It now uses the existing
tickMsoption (startStandInCrew({ tickMs: 50 })), ascrew-declines,crew-pauseandlandingalready do. The production default of 5 s is unchanged. The ticks were the rest of the cost: every wait for a run to finish could sit up to 5 s. - The test still catches Wake reviving a run. I broke it once on purpose:
moveArchivedset runs cancelled withARCHIVED_WHYback toqueuedon Wake. The test failed: the revived run was in the way, so the new run on that issue was refused. Afterwards I restored the code. - Per-test times: the whole file takes 2.86 s, so every test in it is far under 5 s. Bun doesn't print each test's time when they pass, so there's no per-test figure to quote.
bun scripts/gate.ts and bun x tsc --noEmit pass. I couldn't update the plan on the issue because the keep_plan tool wasn't available in this run.
To try it: bun test test/crew.test.ts
🤖 Generated with Claude Code
Approved. The fixed 6 s sleep is replaced by waiting on the next run on the same issue, and the old run is then checked for state, summary and log, which is stricter than before. tickMs: 50 is an existing knob and is used by this file only. The pull quotes 21.49 s before and 2.86 s after, and the builder broke Wake on purpose and saw the test fail. This is a test-only change, so there is no UI, security, or two-door surface to judge. Next: (1) run the file a few times under load to confirm the 50 ms tick does not make it flaky; (2) once bun prints per-test times, quote the slowest test so the 5 s box is shown and not inferred.
bun test test/crew.test.tsnow runs in 2.86 s, down from 21.49 s, measured on this branch before and after the change with the same 4 tests passing. Onlytest/crew.test.tschanges.ok. Only one run per issue runs at a time, and the cancelled run was queued first, so the crew's next pick after Wake would reach it first if it had been revived. Once the new run finishes, the old one is checked again: stillcancelled, its summary is stillARCHIVED_WHY, and its log is still the single archived line. That is more than the old test checked, which was the state alone.tickMsoption (startStandInCrew({ tickMs: 50 })), ascrew-declines,crew-pauseandlandingalready do. The production default of 5 s is unchanged. The ticks were the rest of the cost: every wait for a run to finish could sit up to 5 s.moveArchivedset runs cancelled withARCHIVED_WHYback toqueuedon Wake. The test failed: the revived run was in the way, so the new run on that issue was refused. Afterwards I restored the code.bun scripts/gate.tsandbun x tsc --noEmitpass. I couldn't update the plan on the issue because thekeep_plantool wasn't available in this run.To try it:
bun test test/crew.test.ts🤖 Generated with Claude Code
Closes #9086