devinbost commented on a change in pull request #6202: (Flaky-tests) Reduce 
flakiness of tests
URL: https://github.com/apache/pulsar/pull/6202#discussion_r383489485
 
 

 ##########
 File path: 
pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApiTest.java
 ##########
 @@ -1646,7 +1646,7 @@ public void persistentTopicsCursorResetAfterReset(String 
topicName) throws Excep
         });
 
         for (int i = 0; i < 10; i++) {
-            Message<byte[]> message = consumer.receive();
+            Message<byte[]> message = consumer.receive(5, TimeUnit.SECONDS);
 
 Review comment:
   @sijie I'll double-check on this specific test, but on a lot of the tests, 
what was happening is that either the `receive()` call was hanging or timing 
out too soon (before all the messages were received.) The timeouts that were 
too short involved `consumer.receive(1, TimeUnit.SECONDS);` (if I remember 
correctly), and for one of them, `consumer.receive(3, TimeUnit.SECONDS);` was 
still too short. So, I increased it to `consumer.receive(5, TimeUnit.SECONDS);` 
which seemed to get the tests to pass consistently. 

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


With regards,
Apache Git Services

Reply via email to