Skip to content

test(argus): deterministic refusal in the SPSC ring test - #244

Merged
aien-dev merged 1 commit into
mainfrom
fix/argus-spsc-deterministic-refusal
Oct 2, 2026
Merged

aien-dev merged 1 commit into
mainfrom
fix/argus-spsc-deterministic-refusal

Conversation

@aien-dev

@aien-dev aien-dev commented Oct 2, 2026

Copy link
Copy Markdown
Owner

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 sanitize for 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

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>
@aien-dev
aien-dev merged commit 130aa20 into main Oct 2, 2026
15 checks passed
@aien-dev
aien-dev deleted the fix/argus-spsc-deterministic-refusal branch October 2, 2026 18:15
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