From 153eac1d21ffd5764f02065c9af5cbeab86c1f83 Mon Sep 17 00:00:00 2001 From: Eric E Payne Date: Tue, 10 Mar 2020 14:17:45 +0000 Subject: [PATCH] YARN-942. TestContainerSchedulerQueuing.testKillOnlyRequiredOpportunisticContainers fails sporadically Contributed by Ahmed Hussein (ahussein) (cherry picked from commit ede05b19d1723147430fc426161326d46698507f) --- .../scheduler/TestContainerSchedulerQueuing.java | 6 ++---- 1 file changed, 2 insertions(+), 4 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 70066c695d8..258c5bea5e8 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 @@ -978,16 +978,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 statList = new ArrayList(); 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);