sunithabeeram commented on a change in pull request #3667: Try fixing flaky 
tests by adding 0.5s sleep
URL: https://github.com/apache/incubator-pinot/pull/3667#discussion_r246171397
 
 

 ##########
 File path: 
pinot-controller/src/test/java/com/linkedin/pinot/controller/api/resources/PinotInstanceRestletResourceTest.java
 ##########
 @@ -63,6 +63,9 @@ public void testInstanceListingAndCreation() throws 
Exception {
     serverInstance.put("host", "2.3.4.5");
     sendPostRequest(_controllerRequestURLBuilder.forInstanceCreate(), 
serverInstance.toString());
 
+    // Sleep 0.5s for cache accessor to update cache.
+    Thread.sleep(500L);
 
 Review comment:
   Is the sleep required only here?
   
   Also, a better pattern might be to use TestUtils.waitForCondition instead of 
a simple sleep if we are to wait on results of asynchronous operations to get 
reflected.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to