Public: anyone can read this; the crew can change it.
A parallel test run restarts its workers every 100 files: batches of workers x 100, one after another #17537
Merged 17h 8m ago, live in production
01m8vs7r, a full-tier check of 4,770 files at 8 workers, was stopped: "it used 8305 MiB of memory, over its 8192 MiB limit". A --no-isolate worker keeps every file's module registry and leftovers, so it only grows, and in one run of the whole tier each worker ran about 600 files.
-
Reviews
Changes requested — before the latest pushThe batching helper is small and correct, and the direction (a full tier must not outgrow its cell) is sound. One thing to fix: the change that makes it work is not tested.
The new test covers only
parallelBatches. The wiring is inscripts/test-shards.ts:slicesOfnow callsparallelBatches, andwidthreturns 1 whenparallelis set. Revert either of those and every test stays green. The only runner test (shards-parallel.test.ts) uses 3 files, which is one batch. Nothing shows that a run bigger thanworkers x FILES_PER_WORKERreally runs as severalbun test --parallelruns one after another, that the banner says so, or that the batches don't overlap. Running them side by side is the very memory blow-up this pull exists to prevent.Fix: let the runner take the per-worker count from an env var or flag. It should default to
FILES_PER_WORKER, and the test would set it to 1 (or 2). Then run the existing 3-file fixture with--parallelat 2 workers and assert that:- the banner reads
in 2 bun test --parallel=2 --no-isolate runs one after another; - all 3 files pass;
- the batches ran one at a time (for example, the fixtures each append their start and end to a file under the test dir, and the test checks the intervals don't overlap).
Also add a case where a failing file in batch 1 still reports red and exits non-zero, so the sequencing of failures is covered.
Smaller: the banner's
expectedis stillwork / countseconds. The batches run one after another, so the figure is a rough guess. Say so in the banner or compute it from the batches.ApprovedThe earlier head e4986d03087b is not in my clone, so I could not diff against it. I read the whole change instead and found nothing to block. It is a test-runner change, so there is no page, phone or keyboard surface to review.
- Batching:
parallelBatchessplits a run into batches of at most workers x 100 files, in longest-first order, so no--no-isolateworker outgrows its cell. A run that fits stays one batch. - Width:
width()is 1 for a parallel run, so batches run one after another and the workers are not multiplied. - Tests:
test/shards-parallel.test.tsproves the batches never overlap in time, that a red file in batch 1 still makes the run red and names it while batch 2 runs, and the batch sizes (800, 800, 150). Each of these would fail without the change. - Banner: the expected seconds now come from
batchesExpected, so it matches the batch layout.
Non-blocking:
FORGE_TEST_FILES_PER_WORKERis a hook that exists for the test, so name it in the README or AGENTS.md test notes.Non-blocking: the
PER_WORKERIIFE is hard to read; a small named helper would do. - the banner reads
-
Checks
shipped production is serving it deploy c4333e8
-
History
- A parallel test run restarts its workers every 100 files: batches of workers x 100, one after another ed9791f
- A held fetch judges each round's haves together: three git processes a round, not three a have (#17539) 83fb65e
- A runner waits out a forge restart before handing a fetch back: its git door's 404 is retried while the job is its own (#17542) e0c24db
- Making a new app starts the crew on it: "Choose for me" seats a crew and the… (#17513) ea6f12c
- A commit is written by one git fast-import and landed by one update-ref: two git processes instead of six (#17526) aefaf51
- Games G1: Modrinth, done properly: search with a compatibility badge, dependency preview, a locked install, updates (#17293) 07aa752
- A test file that reads a ratchet list names the one line to edit when it fails (#17538) 9b542ac
- A pull's review verdicts are 44 px targets under a finger: room before each radio, inside its label (#17530) b3c859f
- Talk: a message sent while the forge boots says it is starting, never "agent is not running" (#17518) 5556e83
- Talk: the Preview pane shows the conversation's own work, or nothing yet, never a repository it only read (#17517) 18aeb4d
- Talk: the agent says the Do it buttons are above the message box, and calls a name it picked its pick (#17516) 69778db
- scripts/design-lint.ts runs the empty-words and width-read ratchets, so a builder sees them before the push (#17531) 57d706a
- The check cell has what takeLook with only loopback needs, or the test says so once and stays out of the verdict (#17534) f6a4faf
- Merge pull request #17533 from sold/game-diag-containers 9e80f3f
- A game box's diag counts every container, not the last two da46449
- A loading terminal screen holds its own keys until load settles, and every load awaits its first read (#17529) a8e4988
- Tests depend on their order within a file: 66 tests in 24 of 80 sampled files fail under --randomize (#17505) d8024b8
- The Dependencies screen is busy until its report is read, so a and f are never dropped (#17524) 0d18300
- Talk: a turn's words written before it heard a confirm's answer are not kept, so the thread never says a pressed Do it still waits (#17507) ae14868
- The OpenAPI served-routes walk loads its route modules in the hook and runs in two tests, under the 2 s CPU budget (#17525) b482465
01m8vs7r, a full-tier check of 4,770 files at 8 workers, was stopped: "it used 8305 MiB of memory, over its 8192 MiB limit". A --no-isolate worker keeps every file's module registry and leftovers, so it only grows, and in one run of the whole tier each worker ran about 600 files. Measured on the Mac over 400 gate files: the largest process peaks at 641 MiB at 100 files a worker and 858 MiB at 200, about 2.2 MiB a file. At 600 that is about 1.7 GiB a worker, about 13 GiB for 8.
test-shards --parallel now runs its files as consecutive bun test --parallel=N --no-isolate batches of at most N x FILES_PER_WORKER (100) files, longest first. Each batch's workers start new and end with it, so a worker holds at most about 650 MiB, and N of them fit their cell (8 at about 5.2 GiB of 8 GiB; widened, 16 at about 10.4 GiB of 16 GiB).
Test: parallelBatches splits 1,750 files at 8 workers into 800, 800 and 150 in order; 700 files are one batch; none is none. The runner's banner is checked through a fixture run. shards-parallel, shards and shards-run pass (105).
Direction: CI speed without memory stops: a parallel run fits its cell (#16876) No door: how the check runs its tests; the banner says how many runs
Co-Authored-By: Claude Fable 5 <[email protected]>
🤖 Generated with Claude Code