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

The three real-cell spawn test files run under the test budget #12453

Merged opened this

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

Merged

The three real-cell spawn files now boot their one child in `beforeAll`, wait by polling instead of sleeping, and are off the `SLOW` list in `scripts/gate.ts`. I couldn't measure their speed here: my sandbox runs with `FORGE_TEST_SOCKET=port`, so all three skip. The forge's check on this push is the only timing proof.

shipped production is serving it deploy fc1f404

opened this

The three real-cell spawn files now boot their one child in beforeAll, wait by polling instead of sleeping, and are off the SLOW list in scripts/gate.ts. I couldn't measure their speed here: my sandbox runs with FORGE_TEST_SOCKET=port, so all three skip. The forge's check on this push is the only timing proof.

  • test/helpers/machine-note.ts: a new runHelper runs a real-cell helper once (without FORGE_CELLS) and returns one of three things: its result line, the host's reason to skip, or the full evidence of a failure. All three files call it from beforeAll, so the child's boot counts against the file, not a single test.
  • test/spawn-cell.test.ts: the heartbeat test no longer boots a second child. test/helpers/real-child-forge.ts gives its one child a parent record pointing at an unreachable upstream, as a preview's cell has. It then polls every 100 ms for both the cell's label and the child's first beat, where it used to sleep a fixed 1.5 s. So the same child proves both "serves through its cell" and "its heartbeat reaches the parent with no public address".
  • test/spawn-small-cell.test.ts: the restart backoff is set to 100 ms through noteStop's existing test seam, down from 1 s. The single test is split in two: "holds the Small limits" and "comes back by itself after a memory stop, never answered 429". Both read the same run.
  • test/spawn-cell-e2e.test.ts: same shape, one shared child. test/helpers/real-spawn-e2e.ts now polls the app every 100 ms in both modes.

Nothing was deleted or skipped to save time. Each test still checks what its header says, and each still prints SKIPPING: with the reason on a host without cells. The fourth slow cell file, test/spawn-move-cell-e2e.test.ts, is still on the list; it isn't in this issue.

On this push, the gate and bun x tsc --noEmit pass. Running the three files plus test/test-budget.test.ts gave 52 pass, 6 skip (the real-cell tests), 0 fail.

To check: read the times for the three files in the forge's check log, and see that the real-cell tests ran rather than printing SKIPPING:.

🤖 Generated with Claude Code

Closes #12396

commented

The three real-cell spawn files now boot their one child in beforeAll, wait by polling instead of sleeping, and are off the SLOW list in scripts/gate.ts. I couldn't measure their speed here: my sandbox runs with FORGE_TEST_SOCKET=port, so all three skip. The forge's check on this push is the only timing proof.

  • test/helpers/machine-note.ts: a new runHelper runs a real-cell helper once (without FORGE_CELLS) and returns one of three things: its result line, the host's reason to skip, or the full evidence of a failure. All three files call it from beforeAll, so the child's boot counts against the file, not a single test.
  • test/spawn-cell.test.ts: the heartbeat test no longer boots a second child. test/helpers/real-child-forge.ts gives its one child a parent record pointing at an unreachable upstream, as a preview's cell has. It then polls every 100 ms for both the cell's label and the child's first beat, where it used to sleep a fixed 1.5 s. So the same child proves both "serves through its cell" and "its heartbeat reaches the parent with no public address".
  • test/spawn-small-cell.test.ts: the restart backoff is set to 100 ms through noteStop's existing test seam, down from 1 s. The single test is split in two: "holds the Small limits" and "comes back by itself after a memory stop, never answered 429". Both read the same run.
  • test/spawn-cell-e2e.test.ts: same shape, one shared child. test/helpers/real-spawn-e2e.ts now polls the app every 100 ms in both modes.

Nothing was deleted or skipped to save time. Each test still checks what its header says, and each still prints SKIPPING: with the reason on a host without cells. The fourth slow cell file, test/spawn-move-cell-e2e.test.ts, is still on the list; it isn't in this issue.

On this push, the gate and bun x tsc --noEmit pass. Running the three files plus test/test-budget.test.ts gave 52 pass, 6 skip (the real-cell tests), 0 fail.

To check: read the times for the three files in the forge's check log, and see that the real-cell tests ran rather than printing SKIPPING:.

🤖 Generated with Claude Code

commented

The three real-cell spawn files (test/spawn-cell.test.ts, test/spawn-small-cell.test.ts, test/spawn-cell-e2e.test.ts) now boot one child each in beforeAll, poll instead of sleeping, and are off the SLOW list in scripts/gate.ts. This push also fixes the import cycle that made the last check red.

The red check was an import cycle, not timing. src/actions/repos.ts reaches src/actions/make_it_yours.ts back through its imports. make_it_yours.ts reads FORKS_PER_DAY while its module is being evaluated (COPIES_PER_DAY = FORKS_PER_DAY). Every real-cell helper loads repos.ts first, so each one died with Cannot access 'FORKS_PER_DAY' before initialization before printing a result. That caused the four spawn-cell failures, and also the failure in spawn-move-cell-e2e, a file this pull doesn't touch. Main has the same cycle.

  • Fix: FORKS_PER_DAY moves to a new module, src/actions/fork_limit.ts, which imports nothing. make_it_yours.ts imports it from there, and repos.ts re-exports it, so other importers don't change.
  • Regression test: test/fork-limit-cycle.test.ts starts a fresh process that loads repos.ts first. It fails without the fix and passes with it. The process runs in beforeAll, so its roughly 2–3 s count against the file's budget rather than the 2 s per-test budget.

The test changes:

  • test/helpers/machine-note.ts: a new runHelper runs a real-cell helper once, without FORGE_CELLS. It returns the helper's result line, the host's reason to skip, or the full evidence of a failure.
  • test/spawn-cell.test.ts: the heartbeat test no longer boots a second child. The one child gets a parent record pointing at an unreachable upstream, so it serves both proofs.
  • test/spawn-small-cell.test.ts: the restart backoff is set to 100 ms through noteStop's existing seam. Its single test is split into "holds the Small limits" and "comes back with no 429".

Not done: spawn-stranger-cell also failed on the last check, after 150 s: its first pull closed red. It isn't in this diff, and the check marked it as failing only next to other files, on a machine at load 115 on 72 cores. I left it alone. If it fails again now that these three files run outside the SLOW list, that points to cell contention between those files.

What ran here: bun scripts/gate.ts and bun x tsc --noEmit both pass. bun scripts/fast.ts named 2400 files, so I picked the 20 files that cover the change by hand: all 298 tests that ran passed. The six real-cell tests skip in this sandbox (FORGE_TEST_SOCKET=port means no unix sockets), so none of the new timings are measured yet. The forge's check on this push is the only proof of the real-cell tests and their timings.

To try it: bun test test/fork-limit-cycle.test.ts test/spawn-cell.test.ts test/spawn-small-cell.test.ts test/spawn-cell-e2e.test.ts on a host with bwrap and socat.

🤖 Generated with Claude Code

Approved

The three files now boot one child each in beforeAll via runHelper, poll instead of sleeping, use a 100 ms recovery backoff through noteStop's seam, and are off SLOW; the pull is green with them held to the budget. The cycle fix (fork_limit.ts leaf plus a fresh-process regression test) is needed because the helpers died on it, and is small and tested. Two things I would do next: (1) read the three files' real timings from the check log and record the margin under the 20 s file budget, since the builder's sandbox skips them and the hook boot is the whole file time; (2) spawn-move-cell-e2e still sits on SLOW and spawn-stranger-cell flaked once, so give them the same shape in their own pulls.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs