Flaky-test: NamespacesTest.testSubscribeRate
Fix .
Documentation
This is a bug fix, no need to update doc
@@ -39,6 +39,7 @@ import com.google.common.collect.Sets;
import java.lang.reflect.Field;
import java.net.URI;
import java.net.URL;
+import java.time.Duration;
import java.util.EnumSet;
import java.util.HashSet;
import java.util.List;
@@ -1249,9 +1250,10 @@ public class NamespacesTest extends MockedPulsarServiceBaseTest {
Awaitility.await().untilAsserted(() -> assertFalse(consumer.isConnected()));
// Out of limit period
- Thread.sleep(6000L);
pulsarClient.updateServiceUrl(lookupUrl.toString());
- assertTrue(consumer.isConnected());
+ Awaitility.await()
+ .pollDelay(Duration.ofSeconds(6))
+ .untilAsserted(() -> assertTrue(consumer.isConnected()));
// Disable Subscribe Rate Limiter
subscribeRate = new SubscribeRate(0, 10);
