Fix flakiness in AdvisoryViaNetworkTest by verifying peer broker info on both sides of duplex network#1867
Open
gurpartap3697 wants to merge 1 commit intoapache:mainfrom
Conversation
… on both sides for duplex network
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.
Problem
AdvisoryViaNetworkTest was intermittently failing with errors like:
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
AdvisoryViaNetworkTest30 times locally; 100% pass rate after the fix.