Skip to content

test(stream): drive_image_gen drop cancels in-flight gen (#131)#134

Merged
enriquephl merged 1 commit into
devfrom
test/drive-image-gen-cancel-on-drop
Jun 30, 2026
Merged

test(stream): drive_image_gen drop cancels in-flight gen (#131)#134
enriquephl merged 1 commit into
devfrom
test/drive-image-gen-cancel-on-drop

Conversation

@enriquephl

Copy link
Copy Markdown
Member

Adds the cancel-on-drop test the final review flagged as the one drive_image_gen concurrency guarantee covered only by reasoning.

The test uses a wiremock with a 30s response delay so the first attempt's HTTP stays in-flight, consumes the first Attempt event, then drops the stream — asserting the second candidate (m2) is never requested. It runs in ~0.01s (the 30s delay is never awaited), proving the in-flight request is cancelled on drop rather than blocking.

Follow-up to #133 (image-generation lifecycle frames).

🤖 Generated with Claude Code

Asserts the one concurrency guarantee previously covered only by reasoning:
dropping the helper stream after the first Attempt cancels the in-flight
request so the fallback chain never advances to the second candidate.

Uses a short (200ms) mock response delay and waits past the fallback
window before asserting m2 was never requested, so the test fails if a
regression let the gen run in the background after drop (it would land
m1 and request m2). Addresses codex P3.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@enriquephl enriquephl force-pushed the test/drive-image-gen-cancel-on-drop branch from 3b5997f to 0624c4e Compare June 30, 2026 19:51
@enriquephl enriquephl merged commit 11aa449 into dev Jun 30, 2026
6 checks passed
@enriquephl enriquephl deleted the test/drive-image-gen-cancel-on-drop branch June 30, 2026 19:55
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