Skip to content

test(telemetry): stop the starved-consumer case racing the pool start (#1152) - #1194

Merged
PIsberg merged 1 commit into
mainfrom
fix/telemetry-starved-consumer-flaky
Nov 5, 2026
Merged

PIsberg merged 1 commit into
mainfrom
fix/telemetry-starved-consumer-flaky

Conversation

@PIsberg

@PIsberg PIsberg commented Nov 5, 2026

Copy link
Copy Markdown
Owner

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

  • Failing first: with a 1.5 s producer delay injected, the original test fails with the issue's exact message.
  • Fixed test: 6/6 passes unmodified (`mvn -P fast -pl async-test-lib test -Dtest=TelemetryEventBufferTest`), and passes with the same injected delay.
  • Full CI run: see the checks on this PR.

No docs affected: this changes only a test.

🤖 Generated with Claude Code

…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

codecov Bot commented Nov 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@PIsberg
PIsberg merged commit 8039d63 into main Nov 5, 2026
66 of 69 checks passed
@PIsberg
PIsberg deleted the fix/telemetry-starved-consumer-flaky branch November 5, 2026 19:24
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.

[P3] Flaky: TelemetryEventBufferTest starved-consumer case assumes the buffer fills within 300 ms

1 participant