Repository navigation
fix(test): stabilize MCP catalog recovery timing - #150887
Conversation
Control the six intentional request timeouts from observed HTTP request arrival, retain the real overlap observation window, and await client catalog publication before the final successful call. Extract the HTTP fixture to keep the existing oversized test file from growing. The 50 ms successful-call deadline was a pre-existing test timing race exposed under load, not a regression from #150364. Production behavior and timeout values are unchanged. Validation: 20 file and 20 original-order group runs at both Linux revisions; controlled stall fails before and passes after on Linux and macOS; 99 session-reset tests and check:changed pass. The separate reload marker case passed its single isolated one-worker run in 3.121s (34.96s total wall time). Related: #150364 CI evidence: https://github.com/openclaw/openclaw/actions/runs/35209479990/job/105166410906
|
🦞👀 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, 8:39 AM ET / 12:39 UTC. ClawSweeper reviewWhat this changesThe PR stabilizes an MCP catalog recovery test by controlling intentional timeouts, awaiting catalog publication, and extracting its HTTP server fixture. Merge readiness✅ Ready for maintainer review The timing repair remains useful: current main retains the vulnerable fixture. No actionable correctness or security findings were identified, and this maintainer-owned PR is protected from automatic closure. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw’s session MCP runtime discovers tools from connected servers and rebuilds their catalogs after connection failures. This test checks that recovering one server does not duplicate another server’s pending discovery request. flowchart TD
A[Test requests] --> B[Session MCP runtime]
B --> C[Two local HTTP servers]
C --> D[Intentional request hangs]
D --> E[Controlled timeout advancement]
E --> B
B --> F[Single-flight catalog recovery]
F --> G[Published catalog and successful tool call]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +7. Total +7 across 2 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep recovery coverage at the real HTTP boundary while synchronizing deliberate failures and observing client publication explicitly. Do we have a high-confidence way to reproduce the issue? Yes: source shows the old successful HTTP call competing with a 50 ms wall-clock deadline, and the PR reports a controlled 100 ms stall reproducing that failure before the fix. This review did not execute the reproduction. Is this the best way to solve the issue? Yes: synchronizing intentional timeouts and waiting for client publication addresses the fixture races without increasing production deadlines or weakening the single-flight assertion. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 6a7b1e41d281. 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.
|
Stabilize the MCP catalog recovery regression under busy CI workers. The fixture previously raced the final healthy HTTP call against a 50 ms wall-clock deadline and observed server response submission before client catalog publication. Synchronize six intentional timeouts with observed HTTP request arrival, retain the real 500 ms overlap window and single-flight assertion, and await the published catalog before successful tool execution. Extract the HTTP fixture so the oversized test file shrinks without a baseline change or suppression. Production behavior, timeout values, configuration, dependencies, and schemas are unchanged. This was a pre-existing fixture timing race exposed under load, not a regression from openclaw#150364. Production LOC: 0; tests and support: +186/-179. Validation: controlled 100 ms response stalls failed before and passed after on Linux and macOS; 99 session-reset tests and changed checks passed. The PR records 14 Linux and seven macOS original-shard passes; macOS attempt eight hit the separate untouched reload-marker failure, while this target passed. The separate marker test passed its single isolated check. Exact-head CI run 35221633216 is green with zero pending checks. The accepted Codex review is scoped-clean and ClawSweeper reported no actionable findings or before-merge items. Related: openclaw#150364 CI: https://github.com/openclaw/openclaw/actions/runs/35221633216
Related: #150364
What Problem This Solves
The MCP catalog recovery regression test can time out on its final successful HTTP call when a CI worker is busy, as seen in job 105166410906 on #150803.
User Impact
Improves CI reliability. Production behavior, request timeout values, configuration, dependencies, and schemas are unchanged.
Why This Change Was Made
The fixture used the same 50 ms wall-clock deadline for six deliberate hangs and the final successful call. The test now advances that deadline only after the server receives each intentionally hung request. Real HTTP traffic, the 500 ms overlap observation window, the single-flight assertion, and successful tool execution remain covered. It also waits for the client to publish the recovered catalog instead of treating the server's response submission as completion.
This is a pre-existing test timing race exposed under load, not a regression from #150364. The test and per-server recovery owner are unchanged by #150364, and its unused-server retirement path is not invoked here. A temporary 100 ms response stall reproduces the exact
RequestTimeout(50)on the old parent even after full catalog publication; the repaired fixture passes the same stall. The temporary stall is not included in this change.The HTTP fixture moves into a focused test helper so the existing oversized test file shrinks without a baseline change or suppression.
Evidence
18f505eb41e8and parente1d457ede625each passed 20 whole-file runs (128 tests/run) and 20 original-orderdisposeSession timeoutgroup runs (10 tests/run), with zero natural failures.agentic-agents-core-runtime-hosted-3shard selection passed 14 Linux iterations and seven macOS iterations. macOS iteration 8 failed only in the untouched reload marker test; the repaired target passed in all eight macOS attempts. The shard was not rerun. This separate failure was classified as host overload, and the completed proof was accepted.revokes transferred active work while unrelated transport cleanup is pendingpassed in isolation with one worker and no other work in this worktree: 3.121 s test time, 34.96 s total wall time (/usr/bin/time -p). No retry was used.node scripts/check-changed.mjspassed in full. Fresh Codex branch review (--mode branch --base origin/main --max-priority P1) is scoped-clean on86acccd39914305fe3e09db320a73bacdb06b9e2, with no accepted P0/P1 findings.