Increase TestZkConnectionLost timeout to stable the test. RB=1326718 G=helix-reviewers A=lxia
Project: http://git-wip-us.apache.org/repos/asf/helix/repo Commit: http://git-wip-us.apache.org/repos/asf/helix/commit/e2b1277c Tree: http://git-wip-us.apache.org/repos/asf/helix/tree/e2b1277c Diff: http://git-wip-us.apache.org/repos/asf/helix/diff/e2b1277c Branch: refs/heads/master Commit: e2b1277c84f877fee2accde641334369740a3155 Parents: b5e5e49 Author: Jiajun Wang <[email protected]> Authored: Fri Jun 1 10:43:14 2018 -0700 Committer: jiajunwang <[email protected]> Committed: Thu Jul 12 13:45:17 2018 -0700 ---------------------------------------------------------------------- .../src/main/java/org/apache/helix/task/TaskDriver.java | 7 ++++--- .../org/apache/helix/integration/TestZkConnectionLost.java | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/helix/blob/e2b1277c/helix-core/src/main/java/org/apache/helix/task/TaskDriver.java ---------------------------------------------------------------------- diff --git a/helix-core/src/main/java/org/apache/helix/task/TaskDriver.java b/helix-core/src/main/java/org/apache/helix/task/TaskDriver.java index b04534f..bc767b7 100644 --- a/helix-core/src/main/java/org/apache/helix/task/TaskDriver.java +++ b/helix-core/src/main/java/org/apache/helix/task/TaskDriver.java @@ -859,9 +859,10 @@ public class TaskDriver { .contains(ctx.getWorkflowState())) && System.currentTimeMillis() < st + timeout); if (ctx == null || !allowedStates.contains(ctx.getWorkflowState())) { - throw new HelixException(String - .format("Workflow \"%s\" context is empty or not in states: \"%s\"", workflowName, - targetStates)); + throw new HelixException(String.format( + "Workflow \"%s\" context is empty or not in states: \"%s\", current state: \"%s\"", + workflowName, targetStates.toString(), + ctx == null ? "null" : ctx.getWorkflowState().toString())); } return ctx.getWorkflowState(); http://git-wip-us.apache.org/repos/asf/helix/blob/e2b1277c/helix-core/src/test/java/org/apache/helix/integration/TestZkConnectionLost.java ---------------------------------------------------------------------- diff --git a/helix-core/src/test/java/org/apache/helix/integration/TestZkConnectionLost.java b/helix-core/src/test/java/org/apache/helix/integration/TestZkConnectionLost.java index 3721b2c..85b8554 100644 --- a/helix-core/src/test/java/org/apache/helix/integration/TestZkConnectionLost.java +++ b/helix-core/src/test/java/org/apache/helix/integration/TestZkConnectionLost.java @@ -82,7 +82,7 @@ public class TestZkConnectionLost extends TaskTestBase { WorkflowContext wCtx = TaskTestUtil.pollForWorkflowContext(_driver, queueName); String scheduledQueue = wCtx.getLastScheduledSingleWorkflow(); - _driver.pollForWorkflowState(scheduledQueue, 10000, TaskState.COMPLETED); + _driver.pollForWorkflowState(scheduledQueue, 30000, TaskState.COMPLETED); } @Test(dependsOnMethods = { "testLostZkConnection" }, enabled = false) @@ -108,7 +108,7 @@ public class TestZkConnectionLost extends TaskTestBase { String scheduledQueue = wCtx.getLastScheduledSingleWorkflow(); try{ - _driver.pollForWorkflowState(scheduledQueue, 10000, TaskState.COMPLETED); + _driver.pollForWorkflowState(scheduledQueue, 30000, TaskState.COMPLETED); Assert.fail("Test failure!"); } catch (HelixException ex) { // test succeed
