make producer race test deterministic - #1335
Draft
bgentry wants to merge 1 commit into
Draft
Conversation
bgentry
force-pushed
the
bg/producer-race-test
branch
from
July 30, 2026 19:51
4c0ff54 to
771474c
Compare
The producer concurrency regression processes 10,000 jobs and relies on finishing the last one within a fixed deadline. Race-enabled CI can exercise the intended overlap many times and still fail solely because it misses that throughput deadline. Replace the workload with a coordinated three-job scenario that blocks fetches after capacity is calculated. Complete jobs while fetches are pending and read capacity concurrently across removals and additions. This keeps unsafe active-job accounting visible to the race detector. Assert each capacity transition and verify that a queued third job runs after a slot reopens. Run the scenario through both poll-only and notifier producer setups, using the pilot seam so no production-only test signal is needed. Use zero-based job indices and single-owner gate cleanup to keep the schedule explicit. Stream capacity transitions in order, with cancellation-aware sends, so failures cannot strand the observer.
bgentry
force-pushed
the
bg/producer-race-test
branch
from
July 30, 2026 20:11
771474c to
233208a
Compare
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.
This is a draft alternative to #1248.
The existing race regression test processes 10,000 jobs and relies on the final job starting within a fixed deadline, so race-enabled CI can fail from throughput variance even when the intended concurrency path is exercised.
Replace it with a coordinated three-job scenario that blocks fetches after capacity is calculated. The test completes jobs while fetches are pending, continuously reads capacity across active-job removals and additions, and asserts each capacity transition. A queued third job preserves backlog/refill coverage, and the scenario runs through both poll-only and notifier producer setups.
This guarantees the completion-during-fetch overlap without a wall-clock throughput deadline and keeps unsafe active-job accounting visible to the race detector without adding production-only test instrumentation.