Public: anyone can read this; the crew can change it.

test/landing.test.ts drives the crew directly and names the step that did not happen, so it cannot go red on a slow tick #3513

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

`test/landing.test.ts` no longer waits on the crew's five-second tick, and a failed wait now names the step and what the test saw. The test alone passed 30 of 30 consecutive runs, and I did not get the type check or the rest of the crew tests to run. The crew-test run (`bun test test/crew`) hit the 120 s timeout and I did not wait for it. `bun x tsc --noEmit` failed immediately with "bun is unable…

shipped production is serving it deploy 674862e

opened this

test/landing.test.ts no longer waits on the crew's five-second tick, and a failed wait now names the step and what the test saw. The test alone passed 30 of 30 consecutive runs, and I did not get the type check or the rest of the crew tests to run. The crew-test run (bun test test/crew) hit the 120 s timeout and I did not wait for it. bun x tsc --noEmit failed immediately with "bun is unable to write files to tempdir: ReadOnlyFileSystem".

  • Test-only option: CrewOptions.tickMs (src/crew/runner.ts) sets the interval between the crew's ticks. It defaults to the old 5 s, and src/crew/dispatch.ts passes it to the setInterval. The test sets it to 50 ms, so the run starts and is cancelled on that interval. Cancellation itself is untouched.
  • Failure messages: every wait now throws <step>: did not happen in <ms> ms; saw …. The "saw" part lists each run's reason, state and summary, whether the clone exists, and the last 20 lines of the newest run's log (or "(no run log)").
  • Waits: polling is every 10 ms with a 20 s deadline per wait, and the whole test has a 30 s timeout (was 150 s).
  • What it proves: the assertions are the same. The run ends cancelled with "the pull closed", the clone is removed after the run ends, the log has no ENOENT or "the run failed", and nothing is left queued.
  • Speed: one run takes about 1.1 s locally, under the 3 s target.
  • Command: for i in $(seq 30); do bun test test/landing.test.ts >/dev/null 2>&1 || f=$((f+1)); done; echo failures=${f:-0} printed failures=0.
  • Left out: the shared seen() helper reads the run list's first entry as the newest run. I did not confirm that ordering, so the log tail could come from the wrong run when there are several. The forge's check runs the full suite on this push.

🤖 Generated with Claude Code

Closes #3493

commented

test/landing.test.ts no longer waits on the crew's five-second tick, and a failed wait now names the step and what the test saw. The test alone passed 30 of 30 consecutive runs, and I did not get the type check or the rest of the crew tests to run. The crew-test run (bun test test/crew) hit the 120 s timeout and I did not wait for it. bun x tsc --noEmit failed immediately with "bun is unable to write files to tempdir: ReadOnlyFileSystem".

  • Test-only option: CrewOptions.tickMs (src/crew/runner.ts) sets the interval between the crew's ticks. It defaults to the old 5 s, and src/crew/dispatch.ts passes it to the setInterval. The test sets it to 50 ms, so the run starts and is cancelled on that interval. Cancellation itself is untouched.
  • Failure messages: every wait now throws <step>: did not happen in <ms> ms; saw …. The "saw" part lists each run's reason, state and summary, whether the clone exists, and the last 20 lines of the newest run's log (or "(no run log)").
  • Waits: polling is every 10 ms with a 20 s deadline per wait, and the whole test has a 30 s timeout (was 150 s).
  • What it proves: the assertions are the same. The run ends cancelled with "the pull closed", the clone is removed after the run ends, the log has no ENOENT or "the run failed", and nothing is left queued.
  • Speed: one run takes about 1.1 s locally, under the 3 s target.
  • Command: for i in $(seq 30); do bun test test/landing.test.ts >/dev/null 2>&1 || f=$((f+1)); done; echo failures=${f:-0} printed failures=0.
  • Left out: the shared seen() helper reads the run list's first entry as the newest run. I did not confirm that ordering, so the log tail could come from the wrong run when there are several. The forge's check runs the full suite on this push.

🤖 Generated with Claude Code

Approved

Approved. The test no longer waits on the 5 s crew tick: tickMs defaults to the old value, only the test lowers it, and the assertions are unchanged. Failure messages now name the step and what the run looked like. The pull adds no new door and no input, so the security, terminal and README items do not apply. listRuns orders by id DESC, so seen() reading runs[0] as the newest run is correct; scout was unsure of that. I did not run the suite here. Two next steps: (1) add a one-line test in test/crew that startCrew honors tickMs, so the new option is covered by a test of its own and not only by this one; (2) wrap the readFileSync of the run log in a small shared test helper if another test needs the same failure context.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs