alirezazamani commented on a change in pull request #1181:
URL: https://github.com/apache/helix/pull/1181#discussion_r461705339



##########
File path: 
helix-core/src/test/java/org/apache/helix/integration/task/TestJobQueueCleanUp.java
##########
@@ -105,14 +105,19 @@ public void testJobQueueAutoCleanUp() throws 
InterruptedException {
     }
     _driver.start(builder.build());
     _driver.pollForJobState(queueName, 
TaskUtil.getNamespacedJobName(queueName, "JOB" + (capacity - 1)), 
TaskState.FAILED);
-    Thread.sleep(2000);
 
-    WorkflowConfig config = _driver.getWorkflowConfig(queueName);
-    Assert.assertEquals(config.getJobDag().getAllNodes(), remainJobs);
+    Assert
+        .assertTrue(TestHelper.verify(() -> {
+          WorkflowConfig config = _driver.getWorkflowConfig(queueName);
+          System.out.println("|Current time: " + System.currentTimeMillis() +" 
**TEST: " + config.getJobDag().getAllNodes());
+          return config.getJobDag().getAllNodes().equals(remainJobs);
+        }, 10000));

Review comment:
       Can you change this to TestHeper.WAIT_DURATION?

##########
File path: 
helix-core/src/test/java/org/apache/helix/integration/task/TestJobQueueCleanUp.java
##########
@@ -105,14 +105,19 @@ public void testJobQueueAutoCleanUp() throws 
InterruptedException {
     }
     _driver.start(builder.build());
     _driver.pollForJobState(queueName, 
TaskUtil.getNamespacedJobName(queueName, "JOB" + (capacity - 1)), 
TaskState.FAILED);
-    Thread.sleep(2000);
 
-    WorkflowConfig config = _driver.getWorkflowConfig(queueName);
-    Assert.assertEquals(config.getJobDag().getAllNodes(), remainJobs);
+    Assert
+        .assertTrue(TestHelper.verify(() -> {
+          WorkflowConfig config = _driver.getWorkflowConfig(queueName);
+          System.out.println("|Current time: " + System.currentTimeMillis() +" 
**TEST: " + config.getJobDag().getAllNodes());
+          return config.getJobDag().getAllNodes().equals(remainJobs);
+        }, 10000));
 
-    WorkflowContext context = _driver.getWorkflowContext(queueName);
-    Assert.assertEquals(context.getJobStates().keySet(), remainJobs);
-    
Assert.assertTrue(remainJobs.containsAll(context.getJobStartTimes().keySet()));
+    Assert.assertTrue(TestHelper.verify(() -> {
+      WorkflowContext context = _driver.getWorkflowContext(queueName);
+      return context.getJobStates().keySet().equals(remainJobs) && remainJobs
+          .containsAll(context.getJobStartTimes().keySet());
+    }, 10000));

Review comment:
       Can you change this to TestHeper.WAIT_DURATION?




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



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

Reply via email to