test(context-offloader): raise timeout for sandbox isolation test#2842
Open
notowen333 wants to merge 1 commit into
Open
test(context-offloader): raise timeout for sandbox isolation test#2842notowen333 wants to merge 1 commit into
notowen333 wants to merge 1 commit into
Conversation
The FileStorage isolation test drives a real PosixShellSandbox, so every storage operation spawns an `sh` subprocess (~9 spawns across both agents). Solo it runs in ~1.4s, but under the parallel coverage run that pre-commit invokes, the spawns serialize on CPU and push wall time past the 5s default, making the test flake with a timeout. Give the test a 15s timeout so the subprocess work fits comfortably under load without masking a genuine hang.
lizradway
approved these changes
Jun 16, 2026
Contributor
|
Assessment: Approve A focused, well-justified fix. The PR description's root-cause analysis checks out: Review notes
Nice diagnosis isolating the parallel-coverage variable as the trigger. |
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.
Description
The context-offloader test
isolates a shared storage config by agent sandboxflakes during the pre-commit hook, failing intermittently withTest timed out in 5000ms.The test exercises
FileStorageagainst a realPosixShellSandbox(TestSandbox) on purpose, so it covers the actual sandbox code paths — base64 encoding, shell quoting, metadata sidecar I/O. That fidelity has a cost: every storage operation spawns anshsubprocess, and the test performs ~9 of them across its two agents. Run on its own the test finishes in ~1.4s, comfortably under the 5s default.The flake only appears under the pre-commit hook, which runs
npm run test:coverage— the fullunit-nodesuite in parallel with v8 coverage. Other subprocess-heavy suites (e.g.posix-shell.test.node.ts, 46 such tests) are spawningshat the same time, so the spawns serialize on CPU and each balloons from ~150ms to ~600ms. Wall time climbs to ~6s and trips the 5s ceiling. Isolating either variable confirms the cause: single-fork runs (with or without coverage) pass consistently at ~1.3s; only the parallel run fails.Rather than weaken the test by faking the sandbox, this gives the test a 15s timeout — roughly 2.5x the observed ~6s peak under load. That absorbs a slower or busier CI machine while staying low enough that a genuine hang still fails fast.
Related Issues
Documentation PR
No documentation changes required.
Type of Change
Bug fix
Testing
Reproduced the flake by running the exact pre-commit command (
vitest run --coverage --project unit-node), which failed on the timeout consistently. After the change, ran the same command repeatedly — the test now lands at ~5.8–6.4s and passes every time, with all 3495 unit tests green. Lint, format, and type-check pass.hatch run prepareChecklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.