Repository navigation
test(runtime): bound the start-build race on its child process, not mocha's 5 s default - #541
Merged
Merged
Conversation
…ocha's 5 s default
Upd4ting
marked this pull request as ready for review
November 20, 2026 22:19
Upd4ting
enabled auto-merge
November 20, 2026 22:19
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Wec9b4589-13: the nightly
ci / Stressjob failed 3 of 3 runs on every schedule since 2026-11-17 (runs 44003000993, 44223258026, 44444276974, 44660719011). The 3 child-process tests oftest/core/runtime/start-build-racetime out at 5000 ms beside 4 busy loops per CPU. The test reachedmainwith the promotion of 2026-11-16 (#524), and the first nightly after that failed.What changed
ready, a lease names the entry, and the child exits. The only wall-clock bound was mocha's 5000 ms default, which also has to cover a ts-node child booting on a loaded host. The suite now usesthis.timeout(CHILD_TIMEOUT_MS + 5000), asmodule-cache.leases.test.tsdoes for one child per test.runInChildalready kills a child afterCHILD_TIMEOUT_MS, and that rejectsprintedandexitedwith the child's output. A hung child therefore still fails with a reason instead of mocha's bare timeout.SyntaxError: Unexpected end of JSON inputinreadLeases.RunLeaseFilestages each write as<lease>.json.tmp, then renames it. The core reads only.jsonnames, but the test helper parsed every file in.leases. Theleased()poll could therefore read a half-written staging file.readLeasesnow skips names that do not end in.json, as the core does.Proof
Local reproduction,
test/core/runtime/start-build-race.test.tsalone, beside4 × nprocbusy loops (16 CPUs).Before:
With the timeout raised but the helper unchanged, under the same load:
After, at the host's own load average of about 125 on 16 CPUs, which is above the Stress job's 4 loops per CPU:
The host is shared with other jobs, so 64 more busy loops took it to about 11 runnable processes per CPU. At that load, each of the 2 runs lost one child to its own 30 s
CHILD_TIMEOUT_MSkill. That load is about three times the Stress job's, so this PR keepsCHILD_TIMEOUT_MSas it is. The 20 suites that use the lease helpers pass (145 tests).A manual run cannot reach the nightly tier, so the next scheduled nightly is the Stress proof.
Follow-ups