eolivelli commented on a change in pull request #11281:
URL: https://github.com/apache/pulsar/pull/11281#discussion_r671322733



##########
File path: 
pulsar-broker/src/test/java/org/apache/pulsar/broker/service/SubscriptionSeekTest.java
##########
@@ -531,7 +532,7 @@ public void 
testOnlyCloseActiveConsumerForSingleActiveConsumerDispatcherWhenSeek
         assertEquals(connectedSinceSet.size(), 2);
         consumer1.seek(MessageId.earliest);
         // Wait for consumer to reconnect
-        Thread.sleep(1000);
+        Awaitility.await().until(() -> consumer1.isConnected() == true);

Review comment:
       nit:
   replace "consumer1.isConnected() == true" with `consumer1::isConnected`

##########
File path: 
pulsar-broker/src/test/java/org/apache/pulsar/broker/namespace/OwnershipCacheTest.java
##########
@@ -355,9 +356,9 @@ public void testRemoveOwnership() throws Exception {
         assertEquals(cache.getOwnedBundles().size(), 1);
         cache.removeOwnership(bundle);
         Thread.sleep(500);
-        assertTrue(cache.getOwnedBundles().isEmpty());
+        Awaitility.await().untilAsserted(() -> 
assertTrue(cache.getOwnedBundles().isEmpty()));
+
 
-        Thread.sleep(500);

Review comment:
       probably you have to use `Awaitility.await().untilAsserted` for the line 
below.
   
   because you are dropping this "sleep" as well




-- 
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]


Reply via email to