Repository navigation
fix(test): update repair doctor-error output fails on loaded CI runners - #160319
Conversation
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.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 28, 2026, 5:19 AM ET / 09:19 UTC. ClawSweeper reviewWhat this changesThe 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 Review scores
Verification
How this fits togetherOpenClaw 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]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +21. Total +21 across 1 file. View PR surface stats
Review metrics
Technical reviewBest 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. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Landing note: this PR lands with |
…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.
What Problem This Solves
Fixes: the
update repairdoctor-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-processlane.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-inspectioninstead 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
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.tbx_01m3khsqggar8a9eh7xeqm7ttd(Node 24.19.0):node scripts/run-vitest.mjs src/cli/update-finalization-output.process.test.ts --maxWorkers=1passed 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.tspassed: oxfmt, typecheck, lint, and guards.