Repository navigation
test(gateway): bound concurrent session durability fixture - #170285
Conversation
Use two concurrent requests while preserving the real participant writes that force stale actor input and queue behind its admission/rebase. Assert that both request keys reach the stale-version checkpoint before checking the exactly-once transcript and dispatch results. This intentionally reduces the original eight-request stress workload; it does not establish the cause of the observed RPC timeout or claim a runtime performance fix. Focused runtime qualification remains pending.
|
🦞👀 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. What this changesThis PR reduces the concurrent durability fixture from eight requests to two and verifies that both session keys encounter stale-version refusal. Example: The Gateway durability test creates sessions concurrent-initial-0 and concurrent-initial-1 while participant writes compete.
Review scores
ProductKind: Test only · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it preserves the durability regression’s essential contention checks with a smaller workload, and no actionable correctness or security defect was found. Priority: P3 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe Gateway test sends sessions.create requests through a WebSocket fixture into session actor admission and SQLite persistence, then checks responses, transcript records, and captured dispatches. flowchart LR
A[Two concurrent RPC requests] --> B[Gateway sessions create]
B --> C[Session actor admission]
D[Participant writes] --> C
C --> E[Writer FIFO and rebase]
E --> F[Transcript persistence]
F --> G[Response and dispatch assertions]
Technical reviewBest possible solution: Land the bounded fixture after its required checks pass, preserving the explicit distinction between regression coverage and a production timeout fix. Do we have a high-confidence way to reproduce the issue? The reported response deadlines were not reproduced during this read-only review; source inspection confirms the retained contention mechanism but does not establish the timeout’s cause. Is this the best way to solve the issue? Two concurrent requests retain the explicitly forced stale-version and queued-writer conditions, and the new key assertion prevents silently bypassing those conditions. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against be7696c5e9bc. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceTests +3. Total +3 across 1 file. Added test files: 0. View PR surface stats
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 12, 2026, 6:01 PM ET / 22:01 UTC. |
…170285) ## What Problem This Solves The concurrent Gateway input durability fixture issued eight RPCs while forcing two real participant writes per request and repeatedly exceeded its response deadline. ## User Impact This changes one test file, +4/−1, with no production code or timeout-budget changes. It deliberately reduces eight-way stress coverage and does not establish the product cause of the earlier deadlines or claim a runtime timeout fix. ## Why This Change Was Made Use two concurrent requests and explicitly require both keys to reach the stale-version checkpoint. The real writer contention, successful run-start responses, exactly-once transcript and dispatch checks, and cleanup remain intact. The eight-request fixture originated in openclaw#169107; that is fixture-introduction attribution, not a bisected first-bad timeout commit. ## Evidence Exact head `27d0fb4ceafc445185fa882646f6ad31341d9821` passed [CI run 38313785197](https://github.com/openclaw/openclaw/actions/runs/38313785197): 19 successful jobs and 29 skipped jobs, including a successful CI gate. All 15 cases in `src/gateway/server.sessions.create.durability.test.ts` passed: 95.08 s Vitest duration, 98.21 s test-runner wall time; the concurrent-input case took 3.889 s. Local runtime was not repeated. The exact-head baseline ratchets, source contracts, additional boundaries, selected test types and lint jobs passed. Build artifacts and the published-driver update cell were not selected for this test-only change. One scoped Codex review found no actionable issues; normal commit hooks and diff checks passed. Knip evidence is reused narrowly from [run 38311910220](https://github.com/openclaw/openclaw/actions/runs/38311910220/job/115019807997), head `0c4b38b77adfcd32fc25a18f5d0ed7fb97c2faae`: the changed test blob, package/lock/workspace, all-exports configuration and runner match; the primary Knip configuration differs only in a comment. That actual scan reported only three unrelated team-scale exports, all already removed on this branch. This is scoped evidence for this diff, not a claim that the earlier whole-tree scan passed. The same composition's actual Madge check reported zero cycles; this change adds no production import edge. No production check is removed, and no SQL statement/request or T1 reduction is claimed. There are no schema, update, Doctor, service-lifecycle, plugin-loading or SDK changes. This green PR run does not establish green scheduled CI on main.
What Problem This Solves
The concurrent Gateway input durability fixture issued eight RPCs while forcing two real participant writes per request and repeatedly exceeded its response deadline.
User Impact
This changes one test file, +4/−1, with no production code or timeout-budget changes. It deliberately reduces eight-way stress coverage and does not establish the product cause of the earlier deadlines or claim a runtime timeout fix.
Why This Change Was Made
Use two concurrent requests and explicitly require both keys to reach the stale-version checkpoint. The real writer contention, successful run-start responses, exactly-once transcript and dispatch checks, and cleanup remain intact. The eight-request fixture originated in #169107; that is fixture-introduction attribution, not a bisected first-bad timeout commit.
Evidence
Exact head
27d0fb4ceafc445185fa882646f6ad31341d9821passed CI run 38313785197: 19 successful jobs and 29 skipped jobs, including a successful CI gate. All 15 cases insrc/gateway/server.sessions.create.durability.test.tspassed: 95.08 s Vitest duration, 98.21 s test-runner wall time; the concurrent-input case took 3.889 s. Local runtime was not repeated.The exact-head baseline ratchets, source contracts, additional boundaries, selected test types and lint jobs passed. Build artifacts and the published-driver update cell were not selected for this test-only change. One scoped Codex review found no actionable issues; normal commit hooks and diff checks passed.
Knip evidence is reused narrowly from run 38311910220, head
0c4b38b77adfcd32fc25a18f5d0ed7fb97c2faae: the changed test blob, package/lock/workspace, all-exports configuration and runner match; the primary Knip configuration differs only in a comment. That actual scan reported only three unrelated team-scale exports, all already removed on this branch. This is scoped evidence for this diff, not a claim that the earlier whole-tree scan passed. The same composition's actual Madge check reported zero cycles; this change adds no production import edge.No production check is removed, and no SQL statement/request or T1 reduction is claimed. There are no schema, update, Doctor, service-lifecycle, plugin-loading or SDK changes. This green PR run does not establish green scheduled CI on main.