Repository navigation
test(argus): deterministic refusal in the SPSC ring test - #244
Merged
Merged
Conversation
The two-thread SPSC test asserted sum_refused > 0, which depended on the consumer being slower than the producer. On the CI runner it consumed all 10M attempts with zero refusals and turned main red. The consumer is now held until the producer has offered SPSC_CAP INFORMATIONAL events with nothing popping. The test asserts exactly saturation_point accepted, the rest refused and counted, the first refusal at the watermark, and a stats snapshot (depth, refused[4], no overflow) before release. The identity, FIFO, content and drop-report checks are unchanged. --allow-no-refusals is removed, so the TSan run is held to the same checks. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.
Main was red in one place: the ARGUS ring stress test required that at least one event be refused, but that only happens if the reader is slower than the writer. On the CI machine the reader kept up and nothing was refused, so the check failed even though the ring was behaving correctly.
This change removes the dependence on timing. The reader is now held back until the writer has offered a full ring's worth of low-priority events. The test then checks the exact result: the ring accepts precisely up to its low-priority limit, refuses the rest, counts every refusal, and reports the same ring state before the reader is released. All the accounting, ordering and drop-report checks are unchanged. The "allow no refusals" escape hatch is gone, so the thread-sanitizer run is held to the same standard.
Evidence: the full
make test sanitizefor ARGUS passes locally; 10 of 10 plain runs at 10M events, 6 of 6 pinned to one CPU core, and 8 of 8 thread-sanitizer runs pass. Three deliberately broken rings (refusals not counted, low-priority limit ignored, never refuses) are each caught by the new checks.🤖 Generated with Claude Code