Repository: helix Updated Branches: refs/heads/master ccf263c91 -> 59536d39c
[HELIX-786] TEST: Make TestQuotaBasedScheduling stable Because recent changes caused the Controller to run slower, TestQuotaBasedScheduling was being unstable. This RB fixes this. Changelist: 1. Use polling instead of Thread.sleep() Project: http://git-wip-us.apache.org/repos/asf/helix/repo Commit: http://git-wip-us.apache.org/repos/asf/helix/commit/bced0996 Tree: http://git-wip-us.apache.org/repos/asf/helix/tree/bced0996 Diff: http://git-wip-us.apache.org/repos/asf/helix/diff/bced0996 Branch: refs/heads/master Commit: bced0996ed65c9a886b5e04788e2cc1c88fc37b1 Parents: ccf263c Author: narendly <[email protected]> Authored: Fri Nov 2 14:02:02 2018 -0700 Committer: narendly <[email protected]> Committed: Fri Nov 2 14:02:02 2018 -0700 ---------------------------------------------------------------------- .../helix/integration/task/TestQuotaBasedScheduling.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/helix/blob/bced0996/helix-core/src/test/java/org/apache/helix/integration/task/TestQuotaBasedScheduling.java ---------------------------------------------------------------------- diff --git a/helix-core/src/test/java/org/apache/helix/integration/task/TestQuotaBasedScheduling.java b/helix-core/src/test/java/org/apache/helix/integration/task/TestQuotaBasedScheduling.java index abbcf75..6080399 100644 --- a/helix-core/src/test/java/org/apache/helix/integration/task/TestQuotaBasedScheduling.java +++ b/helix-core/src/test/java/org/apache/helix/integration/task/TestQuotaBasedScheduling.java @@ -374,7 +374,6 @@ public class TestQuotaBasedScheduling extends TaskTestBase { // Finish rest of the tasks _finishTask = true; - Thread.sleep(2000L); } /** @@ -441,16 +440,13 @@ public class TestQuotaBasedScheduling extends TaskTestBase { Workflow secondWorkflow = createWorkflow("secondWorkflow", true, DEFAULT_QUOTA_TYPE, 1, 1, "ShortTask"); _driver.start(secondWorkflow); - Thread.sleep(1000L); // Wait so that the Controller will try to process the workflow // At this point, secondWorkflow should still be in progress due to its task not being scheduled // due to thread pool saturation - TaskState secondWorkflowState = _driver.getWorkflowContext("secondWorkflow").getWorkflowState(); - Assert.assertEquals(secondWorkflowState, TaskState.IN_PROGRESS); + _driver.pollForWorkflowState("secondWorkflow", 2000L, TaskState.IN_PROGRESS); // Finish rest of the tasks _finishTask = true; - Thread.sleep(2000L); } /** @@ -503,7 +499,6 @@ public class TestQuotaBasedScheduling extends TaskTestBase { // Finish rest of the tasks _finishTask = true; - Thread.sleep(2000L); } /** @@ -577,7 +572,6 @@ public class TestQuotaBasedScheduling extends TaskTestBase { // Finish rest of the tasks _finishTask = true; - Thread.sleep(2000L); } /**
