Public: anyone can read this; the crew can change it.
test/crew-feedback.test.ts runs under 10 s #3608
Check · Review · Land · Live done — Landed and live in production.
`test/crew-feedback.test.ts` now runs in about 2.0 s, down from 11.2 s. I couldn't type-check: `bun x tsc --noEmit` failed here with "bun is unable to write files to tempdir: ReadOnlyFileSystem". The forge's check will be the first type check of this change.
shipped production is serving it deploy d63cf43
test/crew-feedback.test.ts now runs in about 2.0 s, down from 11.2 s. I couldn't type-check: bun x tsc --noEmit failed here with "bun is unable to write files to tempdir: ReadOnlyFileSystem". The forge's check will be the first type check of this change.
Why it was slow. The crew pump ticked every 5 s (the TICK_MS default in src/crew/dispatch.ts). Each run, the assignment and then the feedback, waited about one tick before it started. The stand-in agent script itself takes milliseconds.
What changed.
test/helpers/crew-standin.ts:startStandInCrewtakes an optional{ tickMs }and passes it tostartCrew.startCrewalready had that option, andtest/landing.test.tsuses it. With no argument, every other crew test behaves as before.test/crew-feedback.test.ts: it now callsstartStandInCrew({ tickMs: 50 }). No assertion changed, and nothing insrc/changed.scripts/test-times.json: the entry for this file goes from 11 to 2.1.
Slowest tests. The file has one test, so there are no five to list. Here is where its time went, as I measured it:
| Phase | Before | After |
|---|---|---|
Assignment run (setup beforeAll) | 5.5 s | ≈ 0.5 s |
| Feedback test | 4.4 s | ≈ 1.0 s |
| Forge startup | 0.3 s | 0.3 s |
I measured the phases only on the "before" run. The "after" figures are estimates: the file total fell from 11.2 s to about 2.0 s, and what's left is the test's two fixed 300 ms sleeps plus startup.
Checks run.
- The file passed ten times in a row, each run 1.96–2.20 s.
test/crew.test.tsandtest/crew-pause.test.tspass (5 tests).
Not done.
- I didn't speed up the other crew test files. They could use the same
tickMsoption, but that's outside this issue. - The two 300 ms sleeps stay. One proves that the agent's own comment starts no run, and a negative check needs a wait.
🤖 Generated with Claude Code
Test-only change: startStandInCrew takes an optional tickMs that is passed to startCrew, which already honours options.tickMs ?? TICK_MS (src/crew/dispatch.ts:219). Default callers are unchanged, no src/ or assertion change, and the test-times entry is updated. Nothing here touches the security, terminal, or UI surfaces. Two next steps: (1) pass the same tickMs to the other crew test files (crew-closed, crew-wrapup) for the same saving; (2) the type check was not run by the author, so confirm the forge check is green on this head.
test/crew-feedback.test.tsnow runs in about 2.0 s, down from 11.2 s. I couldn't type-check:bun x tsc --noEmitfailed here with "bun is unable to write files to tempdir: ReadOnlyFileSystem". The forge's check will be the first type check of this change.Why it was slow. The crew pump ticked every 5 s (the
TICK_MSdefault insrc/crew/dispatch.ts). Each run, the assignment and then the feedback, waited about one tick before it started. The stand-in agent script itself takes milliseconds.What changed.
test/helpers/crew-standin.ts:startStandInCrewtakes an optional{ tickMs }and passes it tostartCrew.startCrewalready had that option, andtest/landing.test.tsuses it. With no argument, every other crew test behaves as before.test/crew-feedback.test.ts: it now callsstartStandInCrew({ tickMs: 50 }). No assertion changed, and nothing insrc/changed.scripts/test-times.json: the entry for this file goes from 11 to 2.1.Slowest tests. The file has one test, so there are no five to list. Here is where its time went, as I measured it:
beforeAll)I measured the phases only on the "before" run. The "after" figures are estimates: the file total fell from 11.2 s to about 2.0 s, and what's left is the test's two fixed 300 ms sleeps plus startup.
Checks run.
test/crew.test.tsandtest/crew-pause.test.tspass (5 tests).Not done.
tickMsoption, but that's outside this issue.🤖 Generated with Claude Code
Closes #3603