Skip to content

test(rebuild): keep entry-lock test off the host Docker daemon - #14690

Merged
cv merged 1 commit into
mainfrom
cv/fix-rebuild-entry-lock-test
Nov 20, 2026
Merged

cv merged 1 commit into
mainfrom
cv/fix-rebuild-entry-lock-test

Conversation

@cv

@cv cv commented Nov 20, 2026

Copy link
Copy Markdown
Collaborator

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.ts failed in cli-test-shards (2) on #14671 with spawnSync … ETIMEDOUT (run 44642864306, all three attempts, and job 135868445292). All four failures came from the missing case, whose child loads only about 240 source modules. The registered case 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.ts runs detectDockerHost(), which calls the real docker version up to three times with 3 s deadlines. A daemon that answers slowly can therefore cost about 9 s before the preflight starts. Locally, a host docker that answers after 2.8 s makes the unchanged test fail with the same ETIMEDOUT in both cases.

Related issues

Fixes #14689

Changes

  • Put a docker that exits 1 on the test's private PATH (testHome.bin). The preflight under test needs no Docker, and both children now ignore the host daemon.
  • Start the rebuild child together with the lock holder. The child loads its entry module, prints ready, and calls rebuildSandbox or dispatchCli only after the parent sees both processes ready and the lock files exist. The test then writes to the child's stdin.
  • Replace the 10 s spawnSync with 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.
  • Keep all existing assertions: exit status 1, the framed stderr (preflight, onboarding, holder PID, wait, do not delete the lock, aborting, untouched sandbox), and unchanged registry, onboarding lock, and host-lock owner bytes.

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.
  • Same file with CI coverage flags (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.
  • Slow-daemon reproduction, using a host docker that sleeps 2.8 s and exits 1 first on PATH: before the change, both cases failed with spawnSync … ETIMEDOUT after 20.8 s and 18.9 s. After the change, both passed in 4.5 s and 0.96 s.
  • A temporary marker in the fake docker confirmed that the Docker probes reach the fake and not the host daemon.
  • Deliberate break: withRebuildHostFence was changed to return silently on lock contention. Both cases failed: registered with expected +0 to be 1, and missing with expected … to contain 'onboarding'. The break was then reverted.
  • A local reproduction of ci: label pull requests that lead to v1 #14671's shard 2 with CI coverage flags passed. The registered case took 3.6 s and the missing case took 1.4 s.
  • npm run test-size:check passed (7/7). npm run test:titles:check, oxlint, oxfmt --check, and tsc -p tsconfig.cli.json --noEmit also passed.
  • The pre-commit and pre-push hooks passed, including publication validation and the TypeScript checks for the CLI, plugin, and JS config.
  • The diff changes one test file and contains no secrets, API keys, or credentials.

Signed-off-by: Carlos Villela [email protected]

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]>
@cv cv self-assigned this Nov 20, 2026
@copy-pr-bot

copy-pr-bot Bot commented Nov 20, 2026

Copy link
Copy Markdown

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.

@coderabbitai

coderabbitai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@cv

cv commented Nov 20, 2026

Copy link
Copy Markdown
Collaborator Author
Authoring session — opening
Field Status Value Evidence or limit
Harness partial Pi coding agent 1.5.2 (Pit TypeScript tool) Installed release path in the session's injected docs; the session record header stores only format version 3
Skills recorded nemoclaw-contributor-create-pr (complete read, with its publication and validation references) Session record reads to cutoff
Instruction files recorded AGENTS.md (injected) Project context injection at session start
Tool calls partial typescript: 80 Wrapper calls to the cutoff, including failures. Nested shell, git, and gh calls inside each program are not counted
Session window recorded 2026-11-20T03:25Z to 2026-11-20T04:12Z; 47 min First session event to cutoff before PR creation, including idle time
Compactions recorded 0 Complete record to cutoff
Models recorded claude-opus-5-5 Model selection event; no changes
Reasoning levels recorded high Thinking-level event; no changes

@github-code-quality

github-code-quality Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Code coverage overview

Languages: TypeScript

TypeScript / code-coverage/plugin

main 63002cd cv/fix-rebuild-entry... 8545405 +/-
96% 97% +1%
View coverage of the 10 most impacted files.
File main 63002cd cv/fix-rebuild-entry... 8545405 +/-
nemoclaw/src/sh...cy-boundary.cts 100% 97% -3%
nemoclaw/src/onboard/config.ts 98% 96% -2%
nemoclaw/src/ru...time-context.ts 100% 99% -1%
nemoclaw/src/bl...print/runner.ts 95% 95% 0%
nemoclaw/src/bl...ime-identity.ts 97% 97% 0%
nemoclaw/src/bl...t-management.ts 100% 100% 0%
nemoclaw/src/index.ts 94% 99% +5%
nemoclaw/src/de...search-state.ts 0% 100% +100%
nemoclaw/src/on...native-route.ts 0% 100% +100%
nemoclaw/src/search-config.ts 0% 100% +100%

TypeScript / code-coverage/cli

main 63002cd cv/fix-rebuild-entry... 8545405 +/-
84% 86% +2%
View coverage of the 10 most impacted files.
File main 63002cd cv/fix-rebuild-entry... 8545405 +/-
src/lib/onboard.ts 62% 50% -12%
src/lib/actions...ess-recovery.ts 65% 83% +18%
src/lib/inferen...ollama/proxy.ts 41% 61% +20%
src/lib/onboard.../application.ts 55% 84% +29%
src/lib/domain/...y/dimensions.ts 0% 75% +75%
src/lib/inferen...er/lifecycle.ts 0% 75% +75%
src/lib/actions...ry/operation.ts 0% 76% +76%
src/lib/actions...try/snapshot.ts 0% 84% +84%
src/lib/inferen...ovider/index.ts 0% 90% +90%
src/lib/hermes-...yard-routing.ts 0% 95% +95%

ℹ️ Calculations represent line coverage. Results may change as calculations are updated.


Updated November 20, 2026 05:08 UTC

@cv
cv marked this pull request as ready for review November 20, 2026 05:10
@cv
cv merged commit 74ccd7a into main Nov 20, 2026
118 of 120 checks passed
@cv
cv deleted the cv/fix-rebuild-entry-lock-test branch November 20, 2026 05:11
@github-actions github-actions Bot added the v0.0.146 Release target label Nov 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor

PR Review Advisor finished for commit 8545405. Include the Advisor findings in the complete PR feedback collection. Verify and group valid findings before repair.

Request review only when Require no Advisor blockers is green.

All previous runs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v0.0.146 Release target

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flaky CLI test: rebuild-entry-lock.test.ts times out spawning tsx in CI

1 participant