Repository navigation
test(telemetry): stop the starved-consumer case racing the pool start (#1152) - #1194
Merged
Merged
Conversation
…runs (#1152) testMpscConcurrencyWithAStarvedConsumer started the drainer after a fixed 1,300 ms and asserted a drop. A drop needs the buffer full for 1 s with no consumer progress, so the assertion held only if the 8 producers filled 1,024 slots within about 300 ms of the start. Under the full suite's parallel forks it failed once (2026-10-31). The starved case now starts the drainer once buffer.droppedCount() > 0, with a 10 s cap that fails the test. The accounting assertions are unchanged. Verified: the original test fails with the issue's message when producers sleep 1.5 s before publishing (AssertionFailedError: A starved consumer should have cost a drop, expected true but was false). The fixed test passes 6/6 unmodified and passes with the same injected delay. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Fixes #1152.
Why
`testMpscConcurrencyWithAStarvedConsumer` started the drainer after a fixed 1,300 ms and asserted a drop. A drop only happens once the buffer has been full for 1 s with no consumer progress, so the assertion needed the producers to fill 1,024 slots within about 300 ms. Under the full suite's parallel forks it failed once locally (2026-10-31): `A starved consumer should have cost a drop ==> expected: but was: `.
What changed
The starved case now starts the drainer once `buffer.droppedCount() > 0`, bounded by a 10 s cap that fails the test. The accounting assertions (drained plus dropped equals published, no double drain) are unchanged. Test file only; no production change.
Verification
No docs affected: this changes only a test.
🤖 Generated with Claude Code