lhotari commented on a change in pull request #9443:
URL: https://github.com/apache/pulsar/pull/9443#discussion_r569229529
##########
File path:
pulsar-broker/src/test/java/org/apache/pulsar/broker/loadbalance/LoadBalancerTest.java
##########
@@ -176,23 +176,30 @@ void shutdown() throws Exception {
bkEnsemble.stop();
}
- private LeaderBroker loopUntilLeaderChanges(LeaderElectionService les,
LeaderBroker oldLeader,
- LeaderBroker newLeader) throws InterruptedException {
+ private void loopUntilLeaderChangesForAllBroker(List<PulsarService>
activePulsars, LeaderBroker oldLeader)
+ throws InterruptedException {
int loopCount = 0;
+ boolean settled;
while (loopCount < MAX_RETRIES) {
Thread.sleep(1000);
Review comment:
It would be better to replace this loop with Awaitility. An example of
using Awaitility for this type of case is here:
https://github.com/lhotari/pulsar/commit/dc1696030c608fab288b0f8f9921682a702ed1a7#diff-ff0def4f209a344e2ebc9f9d3a6ab32bf67ed12b9c7c6a968a110a6e69c7ed07R192-R196
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]