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

The fast tier runs its files in one bun test --parallel --no-isolate, longest first, in place of N slices #17509

opened this

Merged 24h ago, live in production

test-shards.ts --parallel (switched on in forge.json's check.fast) runs what would have been N slices as one bun test --parallel=N --no-isolate. N warm workers take the files from one queue, longest first: our weights go to Bun as a --timings file (timingsFile in scripts/shards.ts).

Notes

opened this

test-shards.ts --parallel (switched on in forge.json's check.fast) runs what would have been N slices as one bun test --parallel=N --no-isolate. N warm workers take the files from one queue, longest first: our weights go to Bun as a --timings file (timingsFile in scripts/shards.ts). No worker waits on a slice it was statically handed, and no file pays a process start. Without the flag, and for recording, measuring and one-file runs, the slices run as before, in the same code.

Measured before building:

  • A runner (forge-runner-8, nice'd), 80 files 4-way, 3 rounds: slices 17.6 s median against 13.0 s. Same CPU, 506 of 506 pass in both.
  • On the Mac, 400 files 4-way: slices 146 s against 109 s. Largest process 752 MiB against 641 MiB.

Everything that reads a shard reads this as one shard of many files:

  • Its failing files are run alone, and one green alone is named "fails only beside others". The cap on those alone runs, and the hang ceiling, scale with the slices the shard replaces (RETRY_CAP and the ceiling per slice a worker would have run in turn).
  • Its JUnit report times each test.
  • A crash outside a test re-runs it once.
  • The rule and scan files still run first, as their own parallel shard.
  • The CPU-time budget (#17310) judges a breach on the run it is timed again alone. The first pass reads the report's wall times, because the CPU preload's per-test order is one process's and workers interleave; only a breach is timed again.
  • Kept results and the impact map come from single-file measuring runs, which keep their slices: unchanged.
  • Each worker gets its own TMPDIR and FORGE_APP_DATA under the shard's (scripts/test-worker-dirs.ts, keyed by BUN_TEST_WORKER_ID), as each slice had.

Found on the way: in the 400-file run, 2 files failed only under --no-isolate and pass alone: crew-retry-parked (state left by an earlier file) and crew-run-timing (2 timing lines instead of 1). The alone re-run clears them as "fails only beside others". They are a module-state leak between files worth fixing. #17500 is the separate order-within-file finding.

Before, on vxrail: the last full-tier fast checks ran 151-152 slices, about 3,000-3,500 s of slice time, roughly 380-443 s of test phase at 8, and passed in 452-499 s. This pull changes forge.json, so its own check is the full tier in one parallel shard: its "── shard 1/2" line and "passed in" are the after.

Tests (test/shards-parallel.test.ts, through the runner on fixtures):

  • The banner, every file run, and each worker under a worker-N directory.
  • Without the flag, slices as before.
  • A file red only in a worker passes alone and is named "fails only beside others".
  • A file red alone stays red and its test is in the tally.
  • A test spinning past the budget is timed again alone and stays red.
  • The --timings shape. shards-run, shards, test-budget-run, check-rules-first, checks-failure-summary, check-list, flake, plan-line, red-on-main, check-steps, shards-keep-going, check-kept, check-times, tree-scans, check-script-readers and the cross files all pass.

Direction: CI speed: warm workers on one queue remove the slice tail and per-file process starts (#16876) No door: how the check runs its tests; the log's banner says which way ran

Co-Authored-By: Claude Fable 5 <[email protected]>

🤖 Generated with Claude Code

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs