test(stream): drive_image_gen drop cancels in-flight gen (#131)#134
Merged
Conversation
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>
3b5997f to
0624c4e
Compare
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the cancel-on-drop test the final review flagged as the one
drive_image_genconcurrency 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
Attemptevent, 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