ctubbsii commented on a change in pull request #1816:
URL: https://github.com/apache/accumulo/pull/1816#discussion_r532918325



##########
File path: 
server/base/src/test/java/org/apache/accumulo/server/util/time/SimpleTimerTest.java
##########
@@ -70,35 +69,50 @@ public void run() {
     }
   }
 
-  @Test
+  @Test(timeout = 5000)
   public void testOneTimeSchedule() throws InterruptedException {
     AtomicInteger i = new AtomicInteger();
     Incrementer r = new Incrementer(i);
     t.schedule(r, DELAY);
     Thread.sleep(DELAY + PAD);
-    assertEquals(1, i.get());
+    while (true) {
+      if (i.get() == 1) {
+        break;
+      }
+      Thread.sleep(PAD);
+    }

Review comment:
       Just realized that you can simplify this to `while (i.get() != 1) { 
sleep }`; you can do similar things for the other tests 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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to