Avoid retries in subscription example - #1385
Merged
Merged
Conversation
The subscription example leaves a failed job eligible for retry. When it runs again before shutdown, a second failure event stays buffered and breaks the expected output after the client stops. Limit that job to one attempt and expect its discarded state. The example now produces one failed-job event regardless of CI timing.
Contributor
Author
|
@brandur minor flaky fix that came out of another task, originally failed in https://github.com/riverqueue/river/actions/runs/36066052308/job/107855949199 |
bgentry
enabled auto-merge (squash)
September 25, 2026 00:07
brandur
approved these changes
Sep 25, 2026
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.
The subscription example inserts a failing job with the default retry limit. On a busy CI runner, its retry can finish before shutdown and leave a second failed-job event buffered, so the example prints an event instead of the expected closed-channel message.
Set that job's maximum attempts to one and update the expected state to
discarded. This keeps the example focused on subscription behavior and makes its output independent of retry timing.