Repository navigation
test(rebuild): keep entry-lock test off the host Docker daemon - #14690
Merged
Merged
Conversation
The rebuild entry-lock test spawned the rebuild entry with a 10 s spawnSync deadline. Loading the CLI runner probes Docker with up to three 3 s probes, so a slow host daemon pushed the child past the deadline in CI. Give the test a fake docker that fails fast, load the rebuild entry while the lock holder starts, and run it once the locks are held. The deadline now covers the overlapped startup and is documented from CI blob timings. Fixes #14689 Signed-off-by: Carlos Villela <[email protected]>
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
Contributor
Collaborator
Author
Authoring session — opening
|
Contributor
Code coverage overviewLanguages: TypeScript TypeScript / code-coverage/plugin
View coverage of the 10 most impacted files.
TypeScript / code-coverage/cli
View coverage of the 10 most impacted files.
ℹ️ Calculations represent line coverage. Results may change as calculations are updated. Updated |
Contributor
|
PR Review Advisor finished for commit Request review only when Require no Advisor blockers is green. |
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.
Outcome
The rebuild entry-lock test no longer depends on the host Docker daemon, so a slow daemon can no longer push its rebuild child past the deadline. Its rebuild child now loads while the lock holder starts, which cuts the test's local runtime by about 1 s.
Reason
src/lib/actions/sandbox/rebuild-entry-lock.test.tsfailed incli-test-shards (2)on #14671 withspawnSync … ETIMEDOUT(run 44642864306, all three attempts, and job 135868445292). All four failures came from themissingcase, whose child loads only about 240 source modules. Theregisteredcase passed in 4.6 s in the same run, and it loads about 920 modules. So TypeScript compilation was not the cause.Loading
src/lib/runner.tsrunsdetectDockerHost(), which calls the realdocker versionup to three times with 3 s deadlines. A daemon that answers slowly can therefore cost about 9 s before the preflight starts. Locally, a hostdockerthat answers after 2.8 s makes the unchanged test fail with the sameETIMEDOUTin both cases.Related issues
Fixes #14689
Changes
dockerthat exits 1 on the test's privatePATH(testHome.bin). The preflight under test needs no Docker, and both children now ignore the host daemon.ready, and callsrebuildSandboxordispatchClionly after the parent sees both processes ready and the lock files exist. The test then writes to the child's stdin.spawnSyncwith an asynchronous child whose 20 s deadline is based on CI blob reports. Those reports show passing shards ran each case in 2.2–4.7 s, including lock-holder startup. On a timeout, the child's stderr appears in the assertion message.The rebuild still runs in its own process. An in-process version passed but was slower in CI coverage mode. With
--coverage, the cold import of the 916-module rebuild graph took 17.4 s, compared with 5.1 s for the child.Verification
npx vitest run --project cli src/lib/actions/sandbox/rebuild-entry-lock.test.ts: passed 3 times. The registered case took 4.5–4.7 s and the missing case took 0.94–0.97 s. Before the change, they took 5.1 s and 1.4 s. The file took 5.6–5.8 s, compared with 6.6–7.0 s before.CI=true CLI_SHARD=2 CLI_SHARD_COUNT=12 … --coverage): passed in 4.5 s and 0.95 s. Before the change, it took 5.1 s and 1.4 s.dockerthat sleeps 2.8 s and exits 1 first onPATH: before the change, both cases failed withspawnSync … ETIMEDOUTafter 20.8 s and 18.9 s. After the change, both passed in 4.5 s and 0.96 s.dockerconfirmed that the Docker probes reach the fake and not the host daemon.withRebuildHostFencewas changed to return silently on lock contention. Both cases failed: registered withexpected +0 to be 1, and missing withexpected … to contain 'onboarding'. The break was then reverted.npm run test-size:checkpassed (7/7).npm run test:titles:check,oxlint,oxfmt --check, andtsc -p tsconfig.cli.json --noEmitalso passed.Signed-off-by: Carlos Villela [email protected]