Skip to content

fix(test): fix ZeroPrefetchConsumerTest flakiness caused by receiveNoWait() reace#1741

Merged
jbonofre merged 1 commit into
apache:mainfrom
jbonofre:fix-zero-prefetch-consumer-test-flakiness
Mar 9, 2026
Merged

fix(test): fix ZeroPrefetchConsumerTest flakiness caused by receiveNoWait() reace#1741
jbonofre merged 1 commit into
apache:mainfrom
jbonofre:fix-zero-prefetch-consumer-test-flakiness

Conversation

@jbonofre

@jbonofre jbonofre commented Mar 8, 2026

Copy link
Copy Markdown
Member

Replace receiveNoWait() with receive(5000) in doTestRecvRecvCommit and testTwoConsumers where messages are expected to be present.

With zero prefetch, receiveNoWait() sends a MessagePull with timeout=-1 which causes the broker to send NULL_MESSAGE immediately if dest.iterate() cannot dispatch in time (race with ack processing of the previous message).

Using receive(timeout) allows the broker to retry dispatch before timing out.

…Wait() race

Replace receiveNoWait() with receive(5000) in doTestRecvRecvCommit and
testTwoConsumers where messages are expected to be present. With zero
prefetch, receiveNoWait() sends a MessagePull with timeout=-1 which
causes the broker to send NULL_MESSAGE immediately if dest.iterate()
cannot dispatch in time (race with ack processing of the previous
message). Using receive(timeout) allows the broker to retry dispatch
before timing out.
@jbonofre
jbonofre merged commit e95b4a5 into apache:main Mar 9, 2026
9 of 10 checks passed
@jbonofre
jbonofre deleted the fix-zero-prefetch-consumer-test-flakiness branch March 9, 2026 13: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.

2 participants