Skip to content

fix(test): make healthy restart probe fixture deterministic - #150985

Merged
steipete merged 1 commit into
mainfrom
upd/flake-bench-gateway-restart
Sep 17, 2026
Merged

steipete merged 1 commit into
mainfrom
upd/flake-bench-gateway-restart

Conversation

@steipete

Copy link
Copy Markdown
Contributor

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

  • Original failure: run 35237237389, job 105256624351, core-tooling-13-hosted-2, PR head a95974e7ed6d4bef767b48109b39de66c2c0a90d: expected downtimeMs to be null, received 27.192875 ms.
  • Causal reproduction: the full original test file, in its original order, with a temporary 120 ms CPU stall before the healthy fixture’s first response headers, failed only this assertion: 32 passed, 1 failed; firstErrorKind: "timeout", downtimeMs: 26.663667. Diagnostic code was removed.
  • Unmodified baseline: 33/33 tests passed once on macOS and once on Linux. These single runs do not estimate the natural flake rate.
  • Repaired macOS file: 33/33 tests passed, including the unchanged real HTTP tests.
  • node scripts/check-changed.mjs passed completely, including typechecking, all dead-export scans, and lint.
  • Fresh autoreview --mode branch --base origin/main --max-priority P1: scoped-clean, no accepted/actionable findings.
  • The Linux proof tree a0218b0c5d50ec046c3f7d99bc98dd71817f04e2 exactly matches commit 7908c1c3c51c05a2c1132dce05f71f06393ff372.
  • Linux full-shard pressure proof: the original core-tooling-13-hosted-2 selection 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.
  • Linux focused pressure campaign: 20/20 runs, 660/660 tests passed, using 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.

@clawsweeper

clawsweeper Bot commented Sep 17, 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 size: XS maintainer Maintainer-authored PR labels Sep 17, 2026
@steipete
steipete marked this pull request as ready for review September 17, 2026 16:10
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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 17, 2026
@clawsweeper

clawsweeper Bot commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 17, 2026, 12:18 PM ET / 16:18 UTC.

ClawSweeper review

What this changes

The 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
Reviewed head: 7908c1c3c51c05a2c1132dce05f71f06393ff372

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, sound fixture repair with preserved transport coverage and substantial reported validation.
Proof confidence 🌊 off-meta tidepool Not applicable: The ordinary external-contributor proof gate does not apply to this maintainer repair; no production owner changes, and the body reports focused and shard-level pressure validation of the modified fixture.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The ordinary external-contributor proof gate does not apply to this maintainer repair; no production owner changes, and the body reports focused and shard-level pressure validation of the modified fixture.
Evidence reviewed 7 items Verified introduced change: The merge-base-to-head diff changes only the healthy test fixture, preserves its existing assertions, adds error and polling assertions, and restores the spy in finally.
Polling owner and retained transport coverage: The real polling loop consumes requestProbeStatus, records a successful observation, and exits on readiness without an unavailable window. Separate unchanged tests cover real HTTP headers, wall-clock deadlines, and 503-to-200 recovery.
Still necessary on current main: Fetched main still uses a real HTTP server and declares readiness after 60 ms, leaving the reported scheduling-sensitive assumption intact.
Findings None None.
Security None None.

How this fits together

The 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]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests -3. Total -3 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 15 18 -3
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 15 18 -3

Review metrics

None.

Technical review

Best 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.

Labels

Label changes:

  • add P3: This is a bounded test-reliability repair with no runtime or user-visible behavior change.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool 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 ordinary external-contributor proof gate does not apply to this maintainer repair; no production owner changes, and the body reports focused and shard-level pressure validation of the modified fixture.

Label justifications:

  • P3: This is a bounded test-reliability repair with no runtime or user-visible behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool 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 ordinary external-contributor proof gate does not apply to this maintainer repair; no production owner changes, and the body reports focused and shard-level pressure validation of the modified fixture.

Evidence

What I checked:

  • Verified introduced change: The merge-base-to-head diff changes only the healthy test fixture, preserves its existing assertions, adds error and polling assertions, and restores the spy in finally. (test/scripts/bench-gateway-restart.test.ts:749, 7908c1c3c51c)
  • Polling owner and retained transport coverage: The real polling loop consumes requestProbeStatus, records a successful observation, and exits on readiness without an unavailable window. Separate unchanged tests cover real HTTP headers, wall-clock deadlines, and 503-to-200 recovery. (scripts/bench-gateway-restart.ts:478, 7908c1c3c51c)
  • Still necessary on current main: Fetched main still uses a real HTTP server and declares readiness after 60 ms, leaving the reported scheduling-sensitive assumption intact. (test/scripts/bench-gateway-restart.test.ts:748, ce11e2e25c3b)
  • Latest release retains the original fixture: The v2026.9.4 source also contains the HTTP fixture and 60 ms readiness condition; this repair is not present there. (test/scripts/bench-gateway-restart.test.ts:840, 3a9d69db306c)
  • Reported causal reproduction and pressure validation: The captured PR body reports a 120 ms pre-header stall producing the original downtime assertion failure, followed by successful repaired macOS coverage, a Linux 1,284-test shard, and 20 ordered Linux file runs totaling 660 passing tests under CPU pressure. These are contributor-reported results, not tests executed by this review. (7908c1c3c51c)
  • Relevant historical maintenance: Current-main path history includes Peter Steinberger's benchmark fixture consolidation and Vincent Koc's probe deadline work. GitHub commit metadata identifies vincentkoc for the latter and exposes its transport-test patch. Missing historical objects prevented complete local blame verification, so routing does not assert feature introduction. (scripts/lib/gateway-bench-probes.ts, 98feafe78506)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • vincentkoc: 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
steipete merged commit bbb6580 into main Sep 17, 2026
125 checks passed
@steipete
steipete deleted the upd/flake-bench-gateway-restart branch September 17, 2026 16:32
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 18, 2026
…#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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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