Repository navigation
Conversation
… phase
The parallel-safe phase is sized for ~50 ms startup-bound files, but two
entries on shard 19/20 are not that:
* test/js/bun/test/parallel/test-docker-build-*.ts run a full
`docker build --no-cache` (10-20 s, GB-scale RSS while layers are
pulled and dpkg/apk runs). They were placed in that directory before
#33622 made parallel/ a concurrency signal.
* test/js/node/test/parallel/test-buffer-constants.js calls
`' '.repeat(MAX_STRING_LENGTH)`. Under JSC that limit is 2^31-1
(V8's is ~512 MiB), so the single-char repeat materializes a 2 GiB
Latin-1 buffer and touches every page.
On the 7.8 GiB no-swap x64 test runners those two overlapped 2-wide and
the OOM killer SIGKILLed the buffer test (builds 82231, 82241, 82296;
shard 19 on ubuntu 25.04 x64 / debian 13 x64). Linux overcommit lets the
malloc succeed, so there is no catchable RangeError to try/catch around.
Route both back through the serial phase so each gets the machine to
itself; invocation (bun run / bun test) and shard assignment are
otherwise unchanged.
|
Updated 11:34 AM PT - Jul 26th, 2026
❌ @robobun, your commit ca250f6 has 1 failures in
Add 🧪 To try this PR locally: bunx bun-pr 35944That installs a local version of the PR into your bun-35944 --bun |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
WalkthroughChangesParallel-safe test filtering
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@scripts/runner.node.mjs`:
- Around line 614-620: Update the expected-duration classification used by
test/internal/expected-durations.test.ts to match isParallelSafeTest and
parallelSafeMemoryHeavy in scripts/runner.node.mjs, excluding Docker-build tests
and test-buffer-constants.js from concurrent treatment. Regenerate
test/expected-durations.json so these serial tests retain unclamped duration
spans.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 3e407142-56a3-416d-bdd9-1a529c4c60b4
📒 Files selected for processing (1)
scripts/runner.node.mjs
The parallel-safe clamp assertion keys off the js/{node,bun}/test/parallel/
path prefix, but runner.node.mjs now routes the test-docker-build-* files
and test-buffer-constants.js through the serial phase, where
update-test-durations.mjs records real wall-clock spans instead of the
500 ms inter-dispatch clamp. Mirror the exclusion here so the next
regeneration of test/expected-durations.json does not trip the unclamped
check on those five entries.
There was a problem hiding this comment.
LGTM — targeted CI-runner scheduling fix that moves five memory-heavy tests to the serial phase.
What was reviewed:
isParallelSafeTestis used only to partition into phase 1 (serial) vs phase 2 (N-wide) atrunner.node.mjs:907-908; command dispatch is viaisNodeTest(path-based), so the excluded files still run underbunfig.node-test.tomlexactly as before.- Predicate operates on the backslash-normalized
p, so Windows paths match; verified the fourtest-docker-build-*.tsfiles exist at the matched path. expected-durations.jsonkeys (js/bun/test/parallel/test-docker-build-*,js/node/test/parallel/test-buffer-constants.js) match the mirroredmemoryHeavypredicate in the test exactly, and the CodeRabbit sync concern is addressed in f0c36b6.
Extended reasoning...
Overview
Two-file change to CI test-scheduling infrastructure only. scripts/runner.node.mjs gains a parallelSafeMemoryHeavy predicate that returns false from isParallelSafeTest for four test-docker-build-*.ts files and test-buffer-constants.js, moving them from the N-wide phase 2 into the serial phase 1. test/internal/expected-durations.test.ts mirrors the same exclusion so the 500 ms clamp assertion on concurrent-phase spans won't fail once the next duration-table regeneration records real wall-clock spans for these now-serial files. No src/** changes.
Security risks
None. This is CI orchestration only — a path-based predicate over an internally enumerated test list, with no user-controlled input, no auth, no crypto, no network surface.
Level of scrutiny
Low. The only consumer of isParallelSafeTest is the phase-1/phase-2 partition at lines 907–908; returning false simply routes a test into serialTests, which runs under limit (width 1 by default) with concurrent = parallelism > 1. Command selection for these files goes through isNodeTest(testPath) at line 778, which matches on directory path independently of the parallel-safe predicate — so the docker-build and buffer-constants tests still hit the same spawnBun + bunfig.node-test.toml code path they did before, just serialized. The side effect (docker-build stdout now reaching the folded log group because concurrent is false) is called out and bounded.
Other factors
- The predicate is applied to
p = testPath.replaceAll("\\\\", "/"), soincludes/endsWithwork on Windows paths. - Verified via glob that all four
test-docker-build-{alpine,debian,debian-slim,distroless}.tsexist attest/js/bun/test/parallel/and via grep thatexpected-durations.jsonkeys are exactlyjs/bun/test/parallel/test-docker-build-*.tsandjs/node/test/parallel/test-buffer-constants.js, so both the runner predicate and the test-file mirror match them. - CodeRabbit's one concern (keeping
expected-durations.test.tsin sync) was addressed in f0c36b6 and the thread is resolved. The current JSON entries are already ≤500 ms so nothing regresses immediately; the mirror pre-empts the next regeneration. - The root-cause analysis (JSC
MAX_STRING_LENGTH= 2³¹−1 → 2 GiB memset colliding with a concurrentdocker buildon an 8 GiB no-swap host) is well-evidenced with three build logs and matches the fix scope.
|
Fix verified on build 82472 and build 82486, shard 19/20 on both Remaining red on both builds is unrelated to this diff:
Ready for review. |
…comment Shard placement comes from LPT bin-packing over expected-durations.json (regenerated weekly) and maxShards is a tunable, so the hardcoded "Shard 19/20" and bare build numbers would go stale. The predicate is path-based and shard-agnostic anyway; the full repro with build links lives in the PR body per REVIEW.md.
There was a problem hiding this comment.
LGTM — targeted CI-runner scheduling tweak, no product code touched.
What was reviewed:
isParallelSafeTeststill partitions the full test list (excluded files fall through to the serial phase viaserialTests.filter, not dropped); execution path is governed byisNodeTest, which is unchanged, so both docker-build and buffer-constants still run viabunfig.node-test.toml.- Path-separator normalization happens before
parallelSafeMemoryHeavyis called, so Windows paths match. - Mirrored opt-out in
expected-durations.test.tskeeps the ≤500ms clamp assertion aligned with the runner predicate; CodeRabbit's concern is addressed and resolved. - Build 82472 confirms shard 19/20 now runs the three files serially and
test-buffer-constants.jspasses.
Extended reasoning...
Overview
Two files touched, both CI infrastructure:
scripts/runner.node.mjs: adds aparallelSafeMemoryHeavypredicate that excludesjs/bun/test/parallel/test-docker-build-*andjs/node/test/parallel/test-buffer-constants.jsfrom the N-wide parallel-safe phase, so they run in the serial phase instead. The predicate is applied after backslash→forward-slash normalization insideisParallelSafeTest.test/internal/expected-durations.test.ts: mirrors the same exclusion so the ≤500ms clamp assertion (which only applies to concurrent-phase inter-dispatch gaps) skips these files once their real wall-clock spans are recorded.
No src/** changes; the affected test files themselves are untouched.
Security risks
None. This is a test-scheduling change in the CI runner script; no auth, crypto, network, or user-facing surface is involved.
Level of scrutiny
Low. The change is a narrow path-match predicate inserted into an existing serial/parallel partition. I confirmed:
- The partition at
runner.node.mjs:906-908covers the fulltestslist, so excluded files move toserialTestsrather than being dropped. - Execution routing (
isNodeTestat line 1915) is path-based and independent ofisParallelSafeTest, so the docker-build tests and buffer-constants still go through the samebun run --config=bunfig.node-test.tomlinvocation with the same env, just withconcurrent=false(which restores their stdout/stderr to the log inside astartGroup, as the PR description notes). - The four
test-docker-build-*.tsfiles exist on disk and match theincludespattern.
Other factors
- The one review comment (CodeRabbit, on keeping
expected-durations.test.tsin sync) was addressed in f0c36b6 and marked resolved. - The author verified on build 82472 that the previously-SIGKILLed shard now runs the three files serially and passes; remaining red on that build is unrelated flakes / pre-existing binary-size delta.
- Worst-case failure mode of this change is that five test files run serially instead of 2-4-wide, adding ~10-20s to one shard — no correctness risk to the shipped binary.
|
Closing as part of a cleanup of stale pull requests. This PR has had no new commits since 2026-07-26, it conflicts with main, and its last CI run failed. This is not a judgment on the fix itself. If the problem still reproduces on a current build, reopen this PR after a rebase or open a new one against main. |
Fixes
test/js/node/test/parallel/test-buffer-constants.jsgoing red with SIGKILL on shard 19/20 of the linux x64 test lanes.Repro
Builds 82231, 82241 and 82296, all on unrelated feature branches with base
44f6469e0d, shard 19/20 ofubuntu 25.04 x64/debian 13 x64:One slot is still running
test-docker-build-debian.ts(10-20 sdocker build --no-cache) when the other slot reachestest-buffer-constants.js.Cause
test-buffer-constants.jsdoes' '.repeat(MAX_STRING_LENGTH)to prove the constant is not off by one. Under V8 that limit is 536 870 888 (~512 MiB), but JSC'sWTF::StringImpl::MaxLengthis2^31 - 1, so the single-char repeat path (repeatCharacterinJSStringInlines.h) allocates and memsets a 2 GiB Latin-1 buffer:The x64 test runners are 7.8 GiB with no swap. With a concurrent
docker build --no-cachepullingdebian:trixie-slimand runningapt-get install, there is not always 2 GiB free for the memset, and Linux overcommit means thetryCreateUninitializedmalloc succeeds, so the process is OOM-killed during the page-fault loop instead of JSC throwing a catchableRangeError. The same shard/ordering passed on build 80215, so whether the 2 GiB fits depends on where the docker build is at that instant.The overlap exists since #33622 (c464531) made
js/*/test/parallel/a 2-4-wide phase. Thetest-docker-build-*files were placed there in #25210, before the directory name was a concurrency signal, and LPT bin-packing currently puts both on shard 19.Fix
Add a
parallelSafeMemoryHeavyexclusion toisParallelSafeTestsotest-docker-build-*.tsandtest-buffer-constants.jsrun in the serial phase. They still run exactly as before (samebun run --config=bunfig.node-test.tomlpath), just one at a time with the machine to themselves. Shard assignment is unchanged; the four docker builds already bin-pack across shards, so wall-time impact is one extra ~12 s serial slot on the shard that carries them.The test file itself is left verbatim (modulo the existing JSC-error-message patch); it only needs to not share the box with a docker build.
Verification
This is a runner-scheduling change with no
src/**diff; the failure only reproduces when the two processes overlap on an 8 GiB no-swap host, so there is no fail-before test the gate can re-derive locally. Evidence that the fix removes the overlap:isParallelSafeTestnow returnsfalsefor all fourtest-docker-build-*.tsand fortest-buffer-constants.js(Windows-separator paths included),truefor the neighbouringtest-buffer-badhex.js/test-http-*files (inline probe in the commit log of this branch).bun test/js/node/test/parallel/test-buffer-constants.jspasses standalone.node --check scripts/runner.node.mjsis clean.test-docker-build-debian.tsstill running when slot A reachestest-buffer-constants.js.Side effect: docker-build output now reaches the log
In the parallel-safe phase these tests ran with
concurrent=true, sospawnBun's stdout/stderr callbacks were() => {}and the ~350 lines ofdocker build --progress=plainper image were silently dropped. In the serial phase they run inside astartGroup, so that output is now written to the job log (folded under the test's group header, so not visible unless expanded). This is intentional: adocker buildfailure is currently invisible in CI beyond the exit code, and the extra lines are bounded (four files across all shards, folded).[stamp-90s] gate passed · iteration 0 · 2 files touched
passes on PR (with fix)
diff hotspot
gate history · 1 passed · 0 rejected · iteration 0
evidence per changed file