Skip to content

test(gateway): bound concurrent session durability fixture - #170285

Merged
steipete merged 1 commit into
mainfrom
dbasync/redmain-durability-publication
Oct 12, 2026
Merged

steipete merged 1 commit into
mainfrom
dbasync/redmain-durability-publication

Conversation

@steipete

@steipete steipete commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

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 27d0fb4ceafc445185fa882646f6ad31341d9821 passed CI run 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, 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.

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.
@clawsweeper

clawsweeper Bot commented Oct 12, 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 gateway Gateway runtime size: XS labels Oct 12, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 12, 2026
@clawsweeper

clawsweeper Bot commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

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

  • Before: Eight requests exercise contention without an aggregate assertion that every key reaches the stale-version checkpoint.
  • After: Two requests retain the persistence and dispatch checks, and both keys must reach that checkpoint.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The focused patch appears correct and retains meaningful regression coverage; execution evidence is limited to a reported earlier composition with reviewed-head checks pending.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored, test-only PR changes a Gateway regression fixture; it requires no separate user-facing runtime demonstration.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
User problem: The concurrent durability fixture reportedly exceeds its RPC response deadline and disrupts validation.
Reason: The maintainer accepts the narrower stress workload, while the patch retains the original regression mechanism and strengthens checkpoint coverage.

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
Reviewed head: 27d0fb4ceafc445185fa882646f6ad31341d9821

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The cited passing fixture run covers an earlier composition; completion of the reviewed-head test checks was not yet available.
Agent review details

How this fits together

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

Technical review

Best 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

  • Concurrent Gateway durability fixture changes intended behavior with a stated reason (ef6747c: Exercise real competing participant writes to protect stale-version rebasing and writer-FIFO retention during initial-input persistence.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit ef6747c adds src/gateway/server.sessions.create.durability.test.ts:108 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: ef6747c362b7; files: src/gateway/server.sessions.create.durability.test.ts)

PR surface

Tests +3. Total +3 across 1 file. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 4 1 +3
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 4 1 +3

Labels

Label changes:

  • add P3: This is a focused test-fixture adjustment with no production behavior change.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P3: This is a focused test-fixture adjustment with no production behavior change.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 12, 2026, 6:01 PM ET / 22:01 UTC.

@steipete
steipete merged commit 7dd6344 into main Oct 12, 2026
114 of 115 checks passed
@steipete
steipete deleted the dbasync/redmain-durability-publication branch October 12, 2026 22:14
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 13, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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