Skip to content

fix(042): wait for the in-flight call in the full-queue test - #446

Merged
bartekus merged 1 commit into
mainfrom
fix/042-queue-flake
Nov 2, 2026
Merged

bartekus merged 1 commit into
mainfrom
fix/042-queue-flake

Conversation

@bartekus

@bartekus bartekus commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

a_full_queue_refuses_without_enqueueing (spec 042, integrations/rustev-remote-http/tests/context_client.rs) failed in the merge queue for #441 (release-checks / msrv, left: 0, right: 1 at line 215).

Cause: the client counts the first call in depth as soon as it is dispatched, before the fake source has received it, so source.calls can still read 0 when the test asserts it. The test now waits until both depth == 2 and source.calls == 1 before the third fetch. Test-only; no behavior change. Spec: a dated "Test fix" paragraph in 042's implementation record (required by spec coupling; approved spec text, so it ratifies on merge).

Checks: cargo test -p rustev-remote-http --locked (all pass), the test alone 30 consecutive passes, clippy -D warnings, fmt, make gate.

@bartekus
bartekus force-pushed the fix/042-queue-flake branch from f3caac2 to b652559 Compare November 2, 2026 04:34
@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown

AI review (no-findings)

Looking at the two changed files:

integrations/rustev-remote-http/tests/context_client.rs

The change tightens the until predicate by adding s.source.calls.load(Ordering::SeqCst) == 1 to the existing client.counters().depth == 2 check. The rationale matches the comment: the queue counts a call in depth when dispatched (client side), but the source receives it asynchronously, so the old check could proceed before the source had actually handled anything. The strict equality == 1 (rather than >= 1) is consistent with the implied queue design: depth 2 = 1 call active at the source + 1 buffered locally, so exactly 1 call reaches the source while depth stays at 2. The compound condition is sound for those semantics.

specs/042-decision-service-and-remote-seams/spec.md

The addition records the test fix with a datestamp (2026-11-01) and correctly notes "No behavior changes." The spec-first rule in the governance applies to behavior changes; a pure test-fix note is not a behavior claim. The addition appears before the "Decisions at approval" section and is editorial, not normative. No managed-file rules apply here (this is specs/, not .statecraft/derived/).

No concrete defects found in either change.

{"head": "b652559c53322da575428e2c76cda0de32685a0e", "verdict": "no-findings", "findings": []}

Subject: a49e40f...b652559, diff digest b446d49b405c5f448d11aae1fe2bdc0ea6e49e352935190c3ae581140040f73b, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus force-pushed the fix/042-queue-flake branch from b652559 to 7e240fd Compare November 2, 2026 09:52
@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown

AI review (no-findings)

The diff has two parts: a test race-condition fix and the corresponding spec revision note.

Test change (integrations/rustev-remote-http/tests/context_client.rs, line 211):

The original until(|| client.counters().depth == 2) only waited for the client-side depth counter. Because depth is incremented at dispatch time (before the source receives the request), the source's call counter could still be 0 when the test proceeded to send the overflow request. The new compound condition depth == 2 && s.source.calls.load(Ordering::SeqCst) == 1 is correct: it waits until the source has also accepted the in-flight call, confirming the queue is in its intended stable state. Ordering::SeqCst is appropriate for cross-thread visibility. The equality check == 1 (rather than >= 1) is safe here because the source requests block for 5 seconds and the second request is held in the queue, so calls cannot advance past 1 while depth is 2.

Spec change (specs/042-decision-service-and-remote-seams/spec.md):

The revision note accurately describes the test fix, names the file and test, and states "No behavior changes." It is appended to the existing revision notes section, consistent with how prior fixes are recorded in this spec. No governance rule is violated -- this is a test-only fix documented in an already-approved spec's history section.

No defects found.

{"head": "7e240fde6ac35c54fcdaecd87736e2bfadbbbcb1", "verdict": "no-findings", "findings": []}

Subject: 3dc1e1c...7e240fd, diff digest f0b3c8e99dc0e116cb350167ed10b4cd20207c61861253adcb8d02be2aae17bf, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus added this pull request to the merge queue Nov 2, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Nov 2, 2026
@bartekus
bartekus added this pull request to the merge queue Nov 2, 2026
Merged via the queue into main with commit 3d8cad3 Nov 2, 2026
30 checks passed
@bartekus
bartekus deleted the fix/042-queue-flake branch November 2, 2026 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant