Skip to content

make producer race test deterministic - #1335

Draft
bgentry wants to merge 1 commit into
masterfrom
bg/producer-race-test
Draft

make producer race test deterministic#1335
bgentry wants to merge 1 commit into
masterfrom
bg/producer-race-test

Conversation

@bgentry

@bgentry bgentry commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

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.

@bgentry
bgentry force-pushed the bg/producer-race-test branch from 4c0ff54 to 771474c Compare July 30, 2026 19:51
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
bgentry force-pushed the bg/producer-race-test branch from 771474c to 233208a Compare July 30, 2026 20:11
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