helix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hu...@apache.org
Subject [helix] 20/44: Fix TestRecurringJobQueue
Date Sat, 25 May 2019 01:19:54 GMT
This is an automated email from the ASF dual-hosted git repository.

hulee pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/helix.git

commit 2457531e3361714d9b610a233298b63b50daacde
Author: Hunter Lee <hulee@linkedin.com>
AuthorDate: Wed Apr 10 16:58:34 2019 -0700

    Fix TestRecurringJobQueue
    
    This diff fixes TestRecurringJobQueue's testDeletingRecurrentQueueWithHistory
    
    RB=1627625
    G=helix-reviewers
    A=jxue
    
    Signed-off-by: Hunter Lee <hulee@linkedin.com>
---
 .../helix/integration/task/TestRecurringJobQueue.java    | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/helix-core/src/test/java/org/apache/helix/integration/task/TestRecurringJobQueue.java
b/helix-core/src/test/java/org/apache/helix/integration/task/TestRecurringJobQueue.java
index 6d05d38..20970a1 100644
--- a/helix-core/src/test/java/org/apache/helix/integration/task/TestRecurringJobQueue.java
+++ b/helix-core/src/test/java/org/apache/helix/integration/task/TestRecurringJobQueue.java
@@ -264,7 +264,7 @@ public class TestRecurringJobQueue extends TaskTestBase {
     WorkflowContext wCtx;
     // wait until at least 2 workflows are scheduled based on template queue
     do {
-      Thread.sleep(60000);
+      Thread.sleep(60000L);
       wCtx = TaskTestUtil.pollForWorkflowContext(_driver, queueName);
     } while (wCtx.getScheduledWorkflows().size() < 2);
 
@@ -280,16 +280,12 @@ public class TestRecurringJobQueue extends TaskTestBase {
     // Delete recurrent workflow
     _driver.delete(queueName);
 
-    // Try to delete again to make sure things are cleaned up
-    _driver.delete(queueName);
-
+    Thread.sleep(500L);
     // Wait until recurrent workflow and the last scheduled workflow are cleaned up
-    boolean result = TestHelper.verify(new TestHelper.Verifier() {
-      @Override public boolean verify() throws Exception {
-        WorkflowContext wCtx = _driver.getWorkflowContext(queueName);
-        WorkflowContext lastWfCtx = _driver.getWorkflowContext(lastScheduledWorkflow);
-        return (wCtx == null && lastWfCtx == null);
-      }
+    boolean result = TestHelper.verify(() -> {
+      WorkflowContext wCtx1 = _driver.getWorkflowContext(queueName);
+      WorkflowContext lastWfCtx = _driver.getWorkflowContext(lastScheduledWorkflow);
+      return (wCtx1 == null && lastWfCtx == null);
     }, 5 * 1000);
     Assert.assertTrue(result);
 


Mime
View raw message