This is an automated email from the ASF dual-hosted git repository.

gifuma pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/hadoop.git


The following commit(s) were added to refs/heads/trunk by this push:
     new bcfd228  YARN-9599. TestContainerSchedulerQueuing#testQueueShedding 
fails intermittently. Contributed by Abhishek Modi.
bcfd228 is described below

commit bcfd22833633e24881891208503971c8ef59d63c
Author: Giovanni Matteo Fumarola <[email protected]>
AuthorDate: Thu Jun 13 11:08:35 2019 -0700

    YARN-9599. TestContainerSchedulerQueuing#testQueueShedding fails 
intermittently. Contributed by Abhishek Modi.
---
 .../scheduler/TestContainerSchedulerQueuing.java          | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/scheduler/TestContainerSchedulerQueuing.java
 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/scheduler/TestContainerSchedulerQueuing.java
index 3e7a735..05360ab 100644
--- 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/scheduler/TestContainerSchedulerQueuing.java
+++ 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/scheduler/TestContainerSchedulerQueuing.java
@@ -766,11 +766,9 @@ public class TestContainerSchedulerQueuing extends 
BaseContainerManagerTest {
     ContainerScheduler containerScheduler =
         containerManager.getContainerScheduler();
     // Ensure all containers are properly queued.
-    int numTries = 30;
-    while ((containerScheduler.getNumQueuedContainers() < 6) &&
-        (numTries-- > 0)) {
-      Thread.sleep(100);
-    }
+    GenericTestUtils.waitFor(
+        () -> containerScheduler.getNumQueuedContainers() == 6
+            && metrics.getQueuedOpportunisticContainers() == 6, 100, 3000);
     Assert.assertEquals(6, containerScheduler.getNumQueuedContainers());
     Assert.assertEquals(6, metrics.getQueuedOpportunisticContainers());
     Assert.assertEquals(0, metrics.getQueuedGuaranteedContainers());
@@ -779,11 +777,8 @@ public class TestContainerSchedulerQueuing extends 
BaseContainerManagerTest {
         .newInstance();
     containerQueuingLimit.setMaxQueueLength(2);
     containerScheduler.updateQueuingLimit(containerQueuingLimit);
-    numTries = 30;
-    while ((containerScheduler.getNumQueuedContainers() > 2) &&
-        (numTries-- > 0)) {
-      Thread.sleep(100);
-    }
+    GenericTestUtils.waitFor(
+        () -> containerScheduler.getNumQueuedContainers() == 2, 100, 3000);
     Assert.assertEquals(2, containerScheduler.getNumQueuedContainers());
 
     List<ContainerId> statList = new ArrayList<ContainerId>();


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

Reply via email to