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

Tests depend on their order within a file: 66 tests in 24 of 80 sampled files fail under --randomize #17500

shipped production is serving it opened this has it

Landed in pull #17505 · 4 runs · run

opened this

Found during the bun test --parallel trial (claim-perf, 2026-12-02).

What: 80 gate files, chosen by a seeded hash of each name (.looks and browser tests left out), were run on the Mac with bun test --randomize --seed=7. 66 tests in 24 files fail. Run in their written order, the same files pass: 506 tests, 0 failures.

It is test order inside a file, not leakage between files. The same 66 tests, identical by name, fail all three ways the files were run:

  • today's way: 4 × bun test of 20 files each;
  • bun test --parallel=4 (isolated);
  • bun test --parallel=4 --no-isolate.

Each of those files relies on an earlier test in the file to set up state: a user, a repository, a setting.

Files, by failing tests under seed 7:

  • 9: teams-crew
  • 7: forge-signin
  • 6: forks
  • 5: build-pins
  • 4 each: view-source, spawn-upstream, pinned-forge-recovery, code-scanning
  • 3 each: front, feed-chips
  • 2 each: snapshot-mirror-page, origins-import-labels, app-empty-crew
  • 1 each: tui-signins-password, tui-newforge-recipes, perf-jobs-per-forge, mcp-releases, forge-budget-verdict, flows-actions, feed-team-waits, dataimport-doors, branches-action, app-secrets-org-grant, app-home-batched

The attribution comes from the file header that precedes each failure in bun's output. Re-run a file alone with --randomize --seed=7 to confirm.

Why it matters:

  • A test that passes only after its neighbours can't be run alone, kept, or re-run as a flake on its own.
  • Bun's -t filter selects one test; the flake rerun and the kept-results audit depend on that.
  • --randomize is the cheap way to catch new order dependence.

How to fix:

  1. Each test builds what it needs in its own body, or in beforeEach/beforeAll, rather than in an earlier test.
  2. Once a file passes under a few seeds, it can join a randomized run.

Sample list and logs are kept by claim-perf. Repro: bun test --randomize --seed=7 test/teams-crew.test.ts.

1 earlier comment · 1 event
commented

Two more files, found running 400 gate files as bun test --parallel=4 --no-isolate on the Mac (#17509). Both pass alone and fail only when another file ran earlier in the same worker. That means module state leaks between files; the order problem above is within a file.

  • test/crew-retry-parked.test.ts: "a parked-twice issue is tried again > editing its direction retries it". Expected "edited", received undefined. An earlier file in the worker leaves module-level state that the retry path reads.
  • test/crew-run-timing.test.ts: "an agent run's timing line > a finished run ends with the laps in order". Expected 1 timing line, received 2. A module-level collector keeps a line from an earlier file.

The test-shards runner clears both as "fails only beside others" by running them alone, so a check stays green. The fix: reset the module state in each file's beforeEach/afterAll, or move it onto the app or run it belongs to. Repro: bun test --parallel=4 --no-isolate over a few hundred files that include them, or run each right after the file that set the state.

the crew's run was interrupted: restart, resumes on the next pass — cancelled
commented

Red on three checks: pull #17505 failed its check 3 times in a row, so no builder starts on it again. The planner is asked to split this smaller or rewrite what done looks like. The last failure:

check failed: gate: rule "a test does not wait on a real timer": test/app-home-batched.test.ts:147 sleeps; inject a clock and step it, or end the line with // real-timer: <why>

Sign in to join this conversation.

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

Keyboard shortcuts

Docs