Skip to content

Fix flakiness in AdvisoryViaNetworkTest by verifying peer broker info on both sides of duplex network#1867

Merged
jbonofre merged 1 commit intoapache:mainfrom
gurpartap3697:fix/AdvisoryViaNetworkTest-testPrefetchSize1-flaky-test
Apr 5, 2026
Merged

Fix flakiness in AdvisoryViaNetworkTest by verifying peer broker info on both sides of duplex network#1867
jbonofre merged 1 commit intoapache:mainfrom
gurpartap3697:fix/AdvisoryViaNetworkTest-testPrefetchSize1-flaky-test

Conversation

@gurpartap3697
Copy link
Copy Markdown
Contributor

Problem

AdvisoryViaNetworkTest was intermittently failing with errors like:

Consumer on B for topic://A.FOO

ref- https://github.com/apache/activemq/actions/runs/23815739249/job/69531878381?pr=1863

The failure occurs in waitForConsumerOnBroker, indicating that broker B has not yet fully received advisory information about consumers from broker A.

Root Cause

The tests only verified peer broker discovery on broker A. In a duplex network, advisory propagation and peer discovery are bidirectional, but the test did not ensure that broker B had completed initialization and discovered its peer. As a result tests could proceed before broker B was fully ready or leading to race conditions and intermittent failures.

Fix

Added verification of peer broker info on both brokers after startup for duplex network of brokers. This ensures both sides of the duplex network are fully established before test actions begin.

Testing

Ran AdvisoryViaNetworkTest 30 times locally; 100% pass rate after the fix.

@jbonofre jbonofre self-requested a review April 2, 2026 08:25
Copy link
Copy Markdown
Member

@jbonofre jbonofre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks !

@jbonofre jbonofre merged commit 4199744 into apache:main Apr 5, 2026
55 of 60 checks passed
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