Bläddra i källkod

YARN-942. TestContainerSchedulerQueuing.testKillOnlyRequiredOpportunisticContainers fails sporadically Contributed by Ahmed Hussein (ahussein)

(cherry picked from commit ede05b19d1723147430fc426161326d46698507f)
Eric E Payne 5 år sedan
förälder
incheckning
80e394e81b

+ 2 - 4
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

@@ -973,16 +973,14 @@ public class TestContainerSchedulerQueuing extends BaseContainerManagerTest {
     allRequests = StartContainersRequest.newInstance(list);
     containerManager.startContainers(allRequests);
 
-    BaseContainerManagerTest.waitForNMContainerState(containerManager,
-        createContainerId(0), ContainerState.DONE, 40);
-    Thread.sleep(5000);
-
     // Get container statuses. Container 0 should be killed, container 1
     // should be queued and container 2 should be running.
     int killedContainers = 0;
     List<ContainerId> statList = new ArrayList<ContainerId>();
     for (int i = 0; i < 6; i++) {
       statList.add(createContainerId(i));
+      BaseContainerManagerTest.waitForNMContainerState(containerManager,
+          statList.get(i), ContainerState.DONE, 40);
     }
     GetContainerStatusesRequest statRequest =
         GetContainerStatusesRequest.newInstance(statList);