Skip to content

fix(test): make the test gate honest about Bun's limits under host load - #3231

Merged
jcfischer merged 1 commit into
mainfrom
fix/test-gate-load-and-bun
Nov 6, 2026
Merged

jcfischer merged 1 commit into
mainfrom
fix/test-gate-load-and-bun

Conversation

@jcfischer

Copy link
Copy Markdown
Contributor

Problem

bun run check failed on the Mac mini under load and sometimes hung until the supervisor's 1200 s limit. The failures looked like product failures but were not.

Causes and fixes

Cause Measurement Change
bunfig.toml [test] timeout is ignored on Bun 1.4.2 and 1.4.4, so the limit was 5000 ms instead of the intended 20 s A 5.5 s fixture fails under that bunfig on both. migrate-config-dir takes 0.7 s alone and hit 5 s under load scripts/test.ts passes --timeout=20000; the dead key is removed
Bun before 1.4.3 can spin forever in Bun.spawnSync (oven-sh/bun#44581) Upstream's reproducer spins until its timeout on 1.4.2 (3 of 3) and passes on 1.4.4 (3 of 3). Stuck workers sampled here sit in spawn_sync beside a zombie child scripts/test.ts warns on an affected Bun. It does not refuse, so nobody is blocked before the host is upgraded
settle() gave accepted dispatches 250 ms The chain verification test failed at 425 ms at load 39 Accepted dispatches get 15 s; the 9 tests that expect a drop use settleDrop with the old window
The sandbox denial test relied on one read at a fixed 2500 ms delay Failed in 3 full gate runs, 24 of 24 passes in isolation, cause not established The subject repeats the read until a denial is seen. The assertion is unchanged

Evidence

Full suite at nice 15, as the supervisor runs it, on Bun 1.4.4:

Tree Runs Failing runs
main 8 4, all shell suites at 5000 ms
this branch 8 0

At load above 100 the shell suites still reach the 20 s limit, so this does not make the gate immune to extreme overload.

bun run check passes on Bun 1.4.4.

🤖 Generated with Claude Code

Three separate causes made bun run check fail on a loaded host:

- bunfig [test] timeout has never been read by Bun, so every test ran under
  the 5000 ms default rather than the intended 20 s. Shell suites that take
  under 1 s alone reached 5 s at load near 40. scripts/test.ts now passes
  --timeout, which also reaches --parallel workers.
- Bun before 1.4.3 can spin forever in Bun.spawnSync (oven-sh/bun#44581).
  scripts/test.ts now warns on such a version; the remedy is bun upgrade.
- settle() gave an accepted dispatch 250 ms to publish its terminal, and it
  took 425 ms at load 39. Accepted dispatches now get 15 s; tests that expect
  a drop use settleDrop, with the old window.

The sandbox denial test relied on one read at a fixed 2500 ms delay. It now
repeats the read until a denial is observed. The assertion is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jcfischer
jcfischer requested a review from mellanon as a code owner November 6, 2026 02:13
@jcfischer
jcfischer merged commit 2eaf502 into main Nov 6, 2026
12 checks passed
@jcfischer
jcfischer deleted the fix/test-gate-load-and-bun branch November 6, 2026 02:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant