Skip to content

ARTEMIS-6345 Fixing flaky test - #6896

Draft
clebertsuconic wants to merge 1 commit into
apache:mainfrom
clebertsuconic:ARTEMIS-6345
Draft

clebertsuconic wants to merge 1 commit into
apache:mainfrom
clebertsuconic:ARTEMIS-6345

Conversation

@clebertsuconic

Copy link
Copy Markdown
Contributor

The Paho v5 client auto-sends PUBACK immediately after messageArrived returns. With receiveMaximum=1 the topicA PUBACK frees the single quota slot before topicB is even published, so topicB is delivered instead of being queued and the assertEquals(0, received) assertion fails.

Fix both affected tests by setting manualAcks=true so the topicA message stays in-flight during the assertion window.

For the noLocal test an additional race exists: after the re-subscribe the old consumer is closed, its in-flight message is re-queued, and the new consumer can re-deliver it before topicB, consuming the freed quota slot. Fix this by having the consumer publish the topicA message itself so the noLocal filter blocks re-delivery through the new consumer.

The Paho v5 client auto-sends PUBACK immediately after
messageArrived returns. With receiveMaximum=1 the topicA
PUBACK frees the single quota slot before topicB is even
published, so topicB is delivered instead of being queued
and the assertEquals(0, received) assertion fails.

Fix both affected tests by setting manualAcks=true so the
topicA message stays in-flight during the assertion window.

For the noLocal test an additional race exists: after the
re-subscribe the old consumer is closed, its in-flight
message is re-queued, and the new consumer can re-deliver
it before topicB, consuming the freed quota slot. Fix this
by having the consumer publish the topicA message itself so
the noLocal filter blocks re-delivery through the new
consumer.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@clebertsuconic

Copy link
Copy Markdown
Contributor Author

@jbertram I fixed this flaky test with AI. let me know if you want a different fix.. (perhaps using Wait.assertSomething). or if this is good.

the test doesn't fail with these changes.

@clebertsuconic

Copy link
Copy Markdown
Contributor Author

actually... still failed somewhere else.. but this test is flaky

@clebertsuconic
clebertsuconic marked this pull request as draft November 11, 2026 18:42
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