eolivelli commented on a change in pull request #11150:
URL: https://github.com/apache/pulsar/pull/11150#discussion_r661405614
##########
File path:
pulsar-broker/src/test/java/org/apache/pulsar/broker/loadbalance/LoadBalancerTest.java
##########
@@ -321,8 +322,12 @@ public void testBrokerRanking() throws Exception {
}
for (int i = 0; i < BROKER_COUNT; i++) {
- Method updateRanking =
Whitebox.getMethod(SimpleLoadManagerImpl.class, "updateRanking");
- updateRanking.invoke(pulsarServices[i].getLoadManager().get());
+ Method method = Whitebox.getMethod(SimpleLoadManagerImpl.class,
"getUpdateRankingHandle");
+ Object invoke =
method.invoke(pulsarServices[i].getLoadManager().get());
Review comment:
Sorry, I could have suggested it before...
We recently started to use Awaiatility for this kind of waits
What about rewriting the loop this way?
```
Awaiatility.await().until( () -> {
Object invoke = method.invoke(pulsarServices[i].getLoadManager().get());
return invoke != null && invoke.isDone();
});
```
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]