Repository navigation
fix(test): make healthy restart probe fixture deterministic - #150985
Conversation
|
🦞👀 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 17, 2026, 12:18 PM ET / 16:18 UTC. ClawSweeper reviewWhat this changesThe PR makes the healthy restart-probe test supply a controlled successful observation and signal readiness from it instead of relying on HTTP response timing. Merge readiness✅ Ready for maintainer review This remains a useful, focused repair: current main retains the flaky fixture, and the proposed change preserves the polling contract and separate transport coverage. No actionable patch defects were found. Priority: P3 Review scores
Verification
How this fits togetherThe Gateway restart benchmark combines readiness signals and HTTP health observations to measure recovery and downtime. This change affects its test fixture; benchmark behavior remains unchanged. flowchart LR
A[Restart readiness signal] --> C[Restart probe loop]
B[HTTP health observation] --> C
D[Controlled healthy test observation] --> C
C --> E{Unavailable window observed?}
E -->|No| F[Healthy completion without downtime]
E -->|Yes| G[Recovery and downtime measurement]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests -3. Total -3 across 1 file. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep healthy-scenario inputs deterministic while preserving real HTTP deadline and recovery tests and unchanged benchmark timing semantics. Do we have a high-confidence way to reproduce the issue? Yes: the original fixture can exceed the real probe's 100 ms deadline under load and legitimately record downtime. Source supports the reported injected-delay reproduction; this read-only review did not execute it. Is this the best way to solve the issue? Yes: controlling the observation isolates the healthy-completion contract without increasing deadlines, weakening downtime assertions, or removing the separate real-transport tests. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against ce11e2e25c3b. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
…#150985) Fix an intermittent Gateway restart benchmark test failure when a busy runner delays the healthy fixture response beyond the real probe deadline. Supply one healthy observation through the existing requestProbeStatus export and derive readiness from that observation. Preserve the real waitForRestartProbe flow, existing timing and downtime assertions, and separate HTTP deadline and recovery tests. Restore the spy in finally and assert no error or further polling. No user-visible or runtime change. Production/tooling: +0/-0; tests: +15/-18. Related: openclaw#150901. Validation: exact-head CI run 35244901923 passed; recorded proof includes 33/33 macOS tests, 1,284 Linux shard tests, and 660 tests across 20 Linux pressure runs. Independent review was scoped-clean and ClawSweeper found no actionable defects.
Related: #150901
What Problem This Solves
Fixes an intermittent restart benchmark test failure when a busy runner delays the fixture’s HTTP response beyond the probe’s 100 ms deadline.
User Impact
No user-visible or runtime change. This maintainer-requested repair makes the healthy restart-probe scenario deterministic without changing benchmark timeout or downtime semantics.
Why This Change Was Made
The fixture always returned HTTP 200 but declared readiness after 60 ms of wall time. A delayed response could still produce a real timeout, followed by recovery, so the benchmark correctly reported downtime where the fixture assumed none.
The test now supplies a healthy observation through the existing probe export and signals readiness from that observation. It keeps all existing assertions, adds checks for no probe error and no further polling, and restores the spy in
finally. The real HTTP header/deadline tests and the adjacent 503-to-200 restart recovery test remain unchanged. Production/tooling: +0/-0 lines; tests: +15/-18 lines.Evidence
core-tooling-13-hosted-2, PR heada95974e7ed6d4bef767b48109b39de66c2c0a90d: expecteddowntimeMsto be null, received 27.192875 ms.firstErrorKind: "timeout",downtimeMs: 26.663667. Diagnostic code was removed.node scripts/check-changed.mjspassed completely, including typechecking, all dead-export scans, and lint.autoreview --mode branch --base origin/main --max-priority P1: scoped-clean, no accepted/actionable findings.a0218b0c5d50ec046c3f7d99bc98dd71817f04e2exactly matches commit7908c1c3c51c05a2c1132dce05f71f06393ff372.core-tooling-13-hosted-2selection passed 23 files / 1,284 tests on Node 24.19.0, with two Vitest workers and two CPU-bound processes sharing two CPUs (1,080.2 seconds). Testbox lease run. The full-shard result was saved before stopping extra full-shard repetitions and releasing that lease; lease cleanup can mark the hydration workflow cancelled.node scripts/run-vitest.mjs --config test/vitest/vitest.tooling.config.ts test/scripts/bench-gateway-restart.test.ts, two workers, and two CPU-bound processes on two CPUs. Node 24.19.0; retries disabled; each run preserved the full file order. Testbox lease run.