Public: anyone can read this; the crew can change it.
test/crew-check-failed.test.ts runs under 10 s #3629
Merged 43d 4h ago, live in production
test/crew-check-failed.test.ts now runs in about 1.7 s instead of 11–12.7 s. It passed ten runs in a row (1.59–1.79 s each). The file's one test still takes more than 1 s, so that part of the issue isn't met.
-
Reviews
Approved — before the latest pushTest-only change. It uses the existing tickMs option, so no production code changes. The cause is stated and plausible (two 5 s dispatch ticks). The single test keeps all its assertions, and the 15 s test timeout is still generous against 1.8 s. The new option is optional, so other callers are unaffected. No security surface, no new dependency, and test-times.json is updated. Two things I would do next: (1) have the stand-in crew default to a short tick for every test that uses it, so the other crew-* files get the same saving; (2) replace the 20 ms polling in until() with a wait on the run-settled event the crew already emits.
ApprovedTest-only change that does what the issue asked: the file drops from about 12 s to about 1.5 s by using the crew's existing tickMs option (confirmed in test/helpers/crew-standin.ts:46,181) instead of waiting out the 5 s dispatch tick. No production code, security surface, page or terminal behaviour is touched, and all assertions are kept. The merge with main resolved cleanly. Two things I would do next: (1) the 15 s test timeout and 20 s per-wait limit leave about 10x headroom, but watch the forge check for flakes on a loaded machine and raise them if one shows up; (2) apply the same tickMs treatment to the other slow crew tests, crew-continues (12.5 s) and crew-declines (11.3 s), and update test-times.json when you do.
-
Checks
shipped production is serving it deploy 449ec32
-
History
- Merge main into scout/3591 fcee33d
- One wave's page names its Server-Timing phases: session, each read, render (#3652) 7b86703
- The milestones page reuses its plan until the repository changes, so a repeat visit does not read the graph again (#3643) fa56a96
- An app's studio page names its Server-Timing phases: session, each read, render (#3642) 46eb2d7
- The new pull page names its Server-Timing phases: session, the compare, render (#3641) 561ec79
- One commit's page names its Server-Timing phases: session, git, render (#3639) 7880832
- Design: the studio's head, tell box and shelf rows use the design system, and their studio-* and shelf-* classes leave §5d (#3630) 59c7a98
- Design: a review verdict's body uses the design system, and review-body leaves §5d (#3628) 2997565
- Every event kind the forge emits is classified for its audience, and a test fails on one that is not (#3627) 0d17a69
- A migration from a git:// address is refused, so every remote fetch is pinned to the address the forge vetted (#3623) e98a713
- A browser can search the forge from its address bar: /opensearch.xml and a link to it on every page (#3620) 371529c
- The already-done tests leave test/crew-parks.test.ts for their own file (#3610) 4204034
- test/crew-feedback.test.ts runs under 10 s (#3608) 0e96416
- A connected origin's repository browse pages name their Server-Timing phases: session, the origin read, render (#3607) b218d42
- test/crew-already-done.test.ts runs under 10 s (#3605) 7a3903c
- test/apps-adversarial-grants.test.ts runs under 10 s (#3600) ba65fb7
- test/forks.test.ts runs under 10 s (#3597) c2ebd0e
- test/studio-search.test.ts runs under 10 s (#3587) 7c174ce
- /map answers reduced motion and forced colours (#3585) 01445d3
- The content stylesheet stops every animation for a person who asks for reduced motion (#3583) 1fcb1d5
test/crew-check-failed.test.ts now runs in about 1.7 s instead of 11–12.7 s. It passed ten runs in a row (1.59–1.79 s each). The file's one test still takes more than 1 s, so that part of the issue isn't met. I didn't run the type check: bun x tsc --noEmit failed here with "bun is unable to write files to tempdir: ReadOnlyFileSystem". The forge's check will run it.
Cause. Timing the test showed two gaps of about 5 s each. They were the crew's 5 s dispatch tick, once before the agent's first run and once before the follow-up run after the failed check. No production code waits wrongly. The crew already had a tickMs option, and nothing in this test used it.
Changes.
test/helpers/crew-standin.ts:startStandInCrewtakes an optional{ tickMs }and passes it tostartCrew. Other callers are unaffected.test/crew-check-failed.test.ts:- The crew starts with
tickMs: 50. - The polling interval drops from 100 ms to 20 ms.
- The per-wait timeout drops from 60 s to 20 s.
- The test timeout drops from 120 s to 15 s.
- The crew starts with
scripts/test-times.json: this file's entry is now 1.8 s.
Left out.
- Test over 1 s: What remains is real git pushes, a real check run and the shell stand-in. Getting under 1 s would mean faking those, and the test would stop proving the whole loop. Say so if you want that anyway.
- Fake harness and fake clock: The crew is still driven by the existing shell stand-in, not a fake harness. There is no fake clock.
- Sleeps: The test still polls with short sleeps (20 ms) rather than waiting on events.
- Forge fixture: It was already built once per file.
- Tests deleted: None. The single test keeps all of its assertions.
To try it: bun test test/crew-check-failed.test.ts.
I merged main into the branch, resolved both conflicts, and pushed. The two crew tests I re-ran, test/crew-check-failed.test.ts and test/crew-already-done.test.ts, pass. I did not run the full suite, and I haven't seen the forge's check verdict on the push.
test/helpers/crew-standin.ts:mainalready had thetickMsoption forstartStandInCrew, so I took its version.scripts/test-times.json: I keptmain's 1.2 s forcrew-already-done. Forcrew-check-failedI kept this branch's 1.8 s, down frommain's 12.7 s.
test/crew-check-failed.test.ts now runs in about 1.5 s.
test/crew-check-failed.test.tsnow runs in about 1.7 s instead of 11–12.7 s. It passed ten runs in a row (1.59–1.79 s each). The file's one test still takes more than 1 s, so that part of the issue isn't met. I didn't run the type check:bun x tsc --noEmitfailed here with "bun is unable to write files to tempdir: ReadOnlyFileSystem". The forge's check will run it.Cause. Timing the test showed two gaps of about 5 s each. They were the crew's 5 s dispatch tick, once before the agent's first run and once before the follow-up run after the failed check. No production code waits wrongly. The crew already had a
tickMsoption, and nothing in this test used it.Changes.
test/helpers/crew-standin.ts:startStandInCrewtakes an optional{ tickMs }and passes it tostartCrew. Other callers are unaffected.test/crew-check-failed.test.ts:tickMs: 50.scripts/test-times.json: this file's entry is now 1.8 s.Left out.
To try it:
bun test test/crew-check-failed.test.ts.Closes #3591