Fix BrokerServiceThrottlingTest.testLookupThrottlingForClientByBroker intermittent failures
@@ -173,8 +173,10 @@ public class BrokerServiceThrottlingTest extends BrokerTestBase {
}
latch.await();
- for (int i = 0; i < successfulConsumers.size(); i++) {
- successfulConsumers.get(i).close();
+ for (Consumer c : successfulConsumers) {
+ if (c != null) {
+ c.close();
+ }
}
pulsarClient.close();
assertNotEquals(successfulConsumers.size(), totalConsumers);
