Skip to content

fix(test): update repair doctor-error output fails on loaded CI runners - #160319

Merged
steipete merged 1 commit into
mainfrom
fix/update-recovery-flake
Sep 28, 2026
Merged

steipete merged 1 commit into
mainfrom
fix/update-recovery-flake

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes: the update repair doctor-error process test fails intermittently on loaded CI runners (seen in Full Release Validation CI child 36377598582, checks-node-agentic-cli-process, at main fa7c9be).

User Impact

No user-visible change. Removes a load-dependent failure from the release-blocking agentic-cli-process lane.

Why This Change Was Made

The test's recovery clock is real time plus simulated elapsed time. Recovery polling caps each interval sleep at the remaining budget, so on a slow runner a real port read could consume the last bit of that budget. The shared observation deadline then expired in health-wait:port-inspection instead of the interval. The product deliberately keeps the last startup phase only for interval expiry, so it recorded the raw observation timeout, and the strict assertion failed.

The fixture now uses up the recovery budget in the first interval sleep. HTTP probe sleeps keep their exact increments. The doctor-error case models a slow later port read by advancing the controlled clock, which reproduces the race deterministically. This is test support only: production code, assertions, and timeouts are unchanged, and the change adds no retries.

Evidence

  • CI failure: detail: "Exit code: 1; Gateway restart observation timed out during health-wait:port-inspection." vs expected "...Gateway did not settle; startup phase: waiting for managed service" (src/cli/update-finalization-output.process.test.ts:440). The same test passed on the next FRV CI child at 96c5a6a with no relevant code change.
  • Blacksmith Testbox tbx_01m3khsqggar8a9eh7xeqm7ttd (Node 24.19.0):
    • Before the clock fix, with the regression in place, the case failed deterministically with the original text (33.2 s wall).
    • After the fix: node scripts/run-vitest.mjs src/cli/update-finalization-output.process.test.ts --maxWorkers=1 passed 18 tests in 90.8 s wall. The strengthened case takes 3.4 s.
    • node scripts/check-changed.mjs --timed -- src/cli/update-finalization-output.test-support.ts passed: oxfmt, typecheck, lint, and guards.
  • Test cost: no new process cases and no real delays. The modified case runs faster than before (3.4 s).
  • Codex autoreview (gpt-6-astra, P0–P2): scoped-clean.

The doctor-error update-repair case expected the recovery verification to
report "Gateway did not settle; startup phase: waiting for managed service",
but on a loaded runner a real port read could consume the final fake
recovery budget, so the shared deadline expired in health-wait:port-inspection
and the product (intentionally) reported the raw observation timeout instead.

The fixture clock now exhausts the recovery budget inside the first interval
sleep while HTTP probe sleeps keep their exact increments, and the doctor-error
case models a slow subsequent port read with controlled clock advancement so
the original race is reproduced deterministically. Test support only.
@clawsweeper

clawsweeper Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes size: XS labels Sep 28, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 28, 2026
@clawsweeper

clawsweeper Bot commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 28, 2026, 5:19 AM ET / 09:19 UTC.

ClawSweeper review

What this changes

The branch changes the update-repair process-test fixture so recovery polling exhausts its simulated budget in the first interval and the Doctor-error case models a slow later port read.

Merge readiness

✅ Ready for maintainer review

Keep open. Current main retains the timing fixture associated with the reported flake, and this focused PR has reported before-and-after process-test evidence. I found no blocking defect in the introduced change.

Priority: P2
Reviewed head: 4a6ac85b06c08f96067f17515764dbd26a16ae61

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused fixture repair with a clear failure mechanism and reported before-and-after process-test validation.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: The contributor proof gate does not apply to this member-authored test-support PR. The captured PR body reports before-and-after Testbox runs through the update-repair child-process test, with 18 cases passing after the change; no stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The contributor proof gate does not apply to this member-authored test-support PR. The captured PR body reports before-and-after Testbox runs through the update-repair child-process test, with 18 cases passing after the change; no stored-data contract changes.
Evidence reviewed 7 items Introduced change: The pinned PR delta changes only the test-support fixture: it gives recovery intervals a separate simulated clock advance and adds a slow subsequent port-read simulation for the Doctor-error scenario.
Current main still has the earlier fixture: The fetched main revision uses one clock stub for both recovery polling and HTTP-probe sleeps; it does not contain the PR's separate interval clock.
Recovery deadline boundary: The production recovery loop bounds an interval sleep by the remaining budget, while the shared deadline records the active read phase when it expires.
Findings None None.
Security None None.

How this fits together

OpenClaw update repair runs Doctor, checks whether the managed Gateway recovered, and records the result in CLI output and update history. This PR changes the child-process fixture that tests that flow.

flowchart LR
 A[Update repair process test] --> B[Doctor error fixture]
 B --> C[Recovery clock and port read]
 C --> D[Gateway recovery observation]
 D --> E[CLI output and update history]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +21. Total +21 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 28 7 +21
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 28 7 +21

Review metrics

Metric Value Why it matters
Focused test cost 18 cases in 90.8 s; affected case 3.4 s The reported Testbox run exercises the existing process suite without adding a case or a real delay.

Technical review

Best possible solution:

Keep the fixture-level repair so the strict process test checks recovery output and recorded failure facts without depending on runner load.

Do we have a high-confidence way to reproduce the issue?

Yes. The existing Doctor-error process case and shared recovery deadline provide a clear source path for the reported timing failure; the PR also reports a before-fix Testbox reproduction. This read-only review did not execute the test.

Is this the best way to solve the issue?

Yes. Adjusting the isolated fixture clock preserves the production deadline and the strict output assertion while addressing the reported timing race.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against f319fd36a3c8.

Labels

Label changes:

  • add P2: A load-dependent release-validation process-test failure needs repair, with no reported user-runtime change.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The contributor proof gate does not apply to this member-authored test-support PR. The captured PR body reports before-and-after Testbox runs through the update-repair child-process test, with 18 cases passing after the change; no stored-data contract changes.

Label justifications:

  • P2: A load-dependent release-validation process-test failure needs repair, with no reported user-runtime change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The contributor proof gate does not apply to this member-authored test-support PR. The captured PR body reports before-and-after Testbox runs through the update-repair child-process test, with 18 cases passing after the change; no stored-data contract changes.

Evidence

What I checked:

  • Introduced change: The pinned PR delta changes only the test-support fixture: it gives recovery intervals a separate simulated clock advance and adds a slow subsequent port-read simulation for the Doctor-error scenario. (src/cli/update-finalization-output.test-support.ts:61, 4a6ac85b06c0)
  • Current main still has the earlier fixture: The fetched main revision uses one clock stub for both recovery polling and HTTP-probe sleeps; it does not contain the PR's separate interval clock. (src/cli/update-finalization-output.test-support.ts:44, f319fd36a3c8)
  • Recovery deadline boundary: The production recovery loop bounds an interval sleep by the remaining budget, while the shared deadline records the active read phase when it expires. (src/cli/daemon-cli/restart-health.ts:547, 4a6ac85b06c0)
  • Strict process-test contract: The Doctor-error child-process case checks the recorded recovery-verification detail and failure facts, including the managed-service startup phase. (src/cli/update-finalization-output.process.test.ts:440, 4a6ac85b06c0)
  • Reported before-and-after validation: The captured PR body reports a deterministic before-fix failure on a Blacksmith Testbox, then 18 passing process tests in 90.8 seconds after the change; the affected case took 3.4 seconds. These are contributor-reported results, not commands run during this read-only review.
  • Recent area history: Recent merged history on the Gateway recovery owner includes work by Peter Steinberger and Vincent Koc; this supports reviewer routing without claiming either introduced the reported flake. (src/cli/daemon-cli/restart-health.ts, c926e83c8e96)

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vincent Koc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete

Copy link
Copy Markdown
Contributor Author

Landing note: this PR lands with gh pr merge --squash --match-head-commit 4a6ac85b06c08f96067f17515764dbd26a16ae61 instead of the native scripts/pr route. scripts/pr provisions a full per-PR worktree, and the maintainer host is under a disk-capacity hold. The pre-commit oxfmt hook was skipped because the task worktree has no node_modules. Formatting, typecheck, lint, and guards were proven separately on Blacksmith Testbox tbx_01m3khsqggar8a9eh7xeqm7ttd (node scripts/check-changed.mjs --timed -- src/cli/update-finalization-output.test-support.ts, passed). Required openclaw/ci-gate is green on the exact head.

@steipete
steipete merged commit ae3c05a into main Sep 28, 2026
135 checks passed
@steipete
steipete deleted the fix/update-recovery-flake branch September 28, 2026 09:26
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 29, 2026
…openclaw#160319)

The doctor-error update-repair case expected the recovery verification to
report "Gateway did not settle; startup phase: waiting for managed service",
but on a loaded runner a real port read could consume the final fake
recovery budget, so the shared deadline expired in health-wait:port-inspection
and the product (intentionally) reported the raw observation timeout instead.

The fixture clock now exhausts the recovery budget inside the first interval
sleep while HTTP probe sleeps keep their exact increments, and the doctor-error
case models a slow subsequent port read with controlled clock advancement so
the original race is reproduced deterministically. Test support only.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant