test(qwp): make error dispatcher overflow test deterministic - #86
Merged
Conversation
testFullInboxDropsOldestAndCounts slept 50ms after the first offer and assumed the dispatcher thread had already taken the head entry into the blocked handler, freeing an inbox slot. On a loaded Windows CI machine the thread start exceeded 50ms, so the inbox filled one offer early and the overflow path dropped three entries instead of two, failing the dropped-count assertion with expected:<2> but was:<3>. The handler now counts down a handlerEntered latch on entry, and the test awaits it instead of sleeping. dispatchLoop polls the head off the inbox before invoking the handler, so the latch firing proves the slot is free and later offers cannot borrow it.
jerrinot
previously approved these changes
Aug 11, 2026
ideoma
enabled auto-merge (squash)
August 11, 2026 08:56
The full-inbox test assumed the dispatcher thread entered the listener within 50 ms. Slow scheduling left the first event queued and changed the expected overflow count. Wait for listener entry before filling the inbox so the test establishes the required queue state explicitly.
jerrinot
approved these changes
Aug 11, 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 QWP error dispatcher drops the oldest queued entry when its bounded inbox overflows.
testFullInboxDropsOldestAndCountsfills the inbox to capacity and asserts that two offers beyond capacity produce exactly two drops.The test slept 50ms after the first offer and assumed the dispatcher thread had already taken the head entry into the blocked handler, freeing an inbox slot. On a loaded Windows CI machine the thread start exceeded 50ms, so the inbox filled one offer early and the overflow path dropped three entries instead of two, failing the dropped-count assertion. Observed on a Windows CI run:
The teardown warning corroborates the timeline: close() found the dispatcher blocked in the handler holding entry 3 with entries 4-6 still queued, so entries 0-2 were the dropped set -- the drop-oldest path itself behaved correctly.
The handler now counts down a
handlerEnteredlatch on entry, and the test awaits it instead of sleeping.dispatchLooppolls the head off the inbox before invoking the handler, so the latch firing proves the slot is free and later offers cannot borrow it.