hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asur...@apache.org
Subject [03/15] hadoop git commit: YARN-5377. Fix TestQueuingContainerManager.testKillMultipleOpportunisticContainers. (Konstantinos Karanasos via asuresh)
Date Fri, 06 Jan 2017 19:34:33 GMT
YARN-5377. Fix TestQueuingContainerManager.testKillMultipleOpportunisticContainers. (Konstantinos
Karanasos via asuresh)

(cherry picked from commit f38a6d03a11ca6de93a225563ddf55ec99d5063c)
(cherry picked from commit 83ccab8a653a4ef943276651c9604bd434675980)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/0e60c7cd
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/0e60c7cd
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/0e60c7cd

Branch: refs/heads/branch-2
Commit: 0e60c7cd33b02cd89f635386c1edd5a8eadb1689
Parents: 7437252
Author: Arun Suresh <asuresh@apache.org>
Authored: Mon Nov 7 22:10:03 2016 -0800
Committer: Arun Suresh <asuresh@apache.org>
Committed: Fri Jan 6 11:15:09 2017 -0800

----------------------------------------------------------------------
 .../BaseContainerManagerTest.java               | 38 +++++++++++++-------
 .../queuing/TestQueuingContainerManager.java    |  6 ++--
 2 files changed, 29 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/0e60c7cd/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/BaseContainerManagerTest.java
----------------------------------------------------------------------
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/BaseContainerManagerTest.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/BaseContainerManagerTest.java
index cb7815e..609d549 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/BaseContainerManagerTest.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/BaseContainerManagerTest.java
@@ -284,15 +284,17 @@ public abstract class BaseContainerManagerTest {
         .build());
   }
 
-  public static void waitForContainerState(ContainerManagementProtocol containerManager,
-      ContainerId containerID, ContainerState finalState)
+  public static void waitForContainerState(
+      ContainerManagementProtocol containerManager, ContainerId containerID,
+      ContainerState finalState)
       throws InterruptedException, YarnException, IOException {
     waitForContainerState(containerManager, containerID, finalState, 20);
   }
 
-  public static void waitForContainerState(ContainerManagementProtocol containerManager,
-          ContainerId containerID, ContainerState finalState, int timeOutMax)
-          throws InterruptedException, YarnException, IOException {
+  public static void waitForContainerState(
+      ContainerManagementProtocol containerManager, ContainerId containerID,
+      ContainerState finalState, int timeOutMax)
+      throws InterruptedException, YarnException, IOException {
     List<ContainerId> list = new ArrayList<ContainerId>();
     list.add(containerID);
     GetContainerStatusesRequest request =
@@ -314,8 +316,9 @@ public abstract class BaseContainerManagerTest {
           finalState, containerStatus.getState());
   }
 
-  static void waitForApplicationState(ContainerManagerImpl containerManager,
-      ApplicationId appID, ApplicationState finalState)
+  public static void waitForApplicationState(
+      ContainerManagerImpl containerManager, ApplicationId appID,
+      ApplicationState finalState)
       throws InterruptedException {
     // Wait for app-finish
     Application app =
@@ -344,7 +347,16 @@ public abstract class BaseContainerManagerTest {
   public static void waitForNMContainerState(ContainerManagerImpl
       containerManager, ContainerId containerID,
           org.apache.hadoop.yarn.server.nodemanager.containermanager
-          .container.ContainerState finalState, int timeOutMax)
+              .container.ContainerState finalState, int timeOutMax)
+                  throws InterruptedException, YarnException, IOException {
+    waitForNMContainerState(containerManager, containerID,
+        Arrays.asList(finalState), timeOutMax);
+  }
+
+  public static void waitForNMContainerState(ContainerManagerImpl
+      containerManager, ContainerId containerID,
+          List<org.apache.hadoop.yarn.server.nodemanager.containermanager
+          .container.ContainerState> finalStates, int timeOutMax)
               throws InterruptedException, YarnException, IOException {
     Container container = null;
     org.apache.hadoop.yarn.server.nodemanager
@@ -358,15 +370,15 @@ public abstract class BaseContainerManagerTest {
         currentState = container.getContainerState();
       }
       if (currentState != null) {
-        LOG.info("Waiting for NM container to get into state " + finalState
-            + ". Current state is " + currentState);
+        LOG.info("Waiting for NM container to get into one of the following " +
+            "states: " + finalStates + ". Current state is " + currentState);
       }
       timeoutSecs += 2;
-    } while (!currentState.equals(finalState)
+    } while (!finalStates.contains(currentState)
         && timeoutSecs++ < timeOutMax);
     LOG.info("Container state is " + currentState);
-    Assert.assertEquals("ContainerState is not correct (timedout)",
-        finalState, currentState);
+    Assert.assertTrue("ContainerState is not correct (timedout)",
+        finalStates.contains(currentState));
   }
 
   public static Token createContainerToken(ContainerId cId, long rmIdentifier,

http://git-wip-us.apache.org/repos/asf/hadoop/blob/0e60c7cd/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/queuing/TestQueuingContainerManager.java
----------------------------------------------------------------------
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/queuing/TestQueuingContainerManager.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/queuing/TestQueuingContainerManager.java
index caebef7..7f06afa 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/queuing/TestQueuingContainerManager.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/queuing/TestQueuingContainerManager.java
@@ -467,8 +467,10 @@ public class TestQueuingContainerManager extends BaseContainerManagerTest
{
         StartContainersRequest.newInstance(list);
     containerManager.startContainers(allRequests);
 
-    BaseContainerManagerTest.waitForNMContainerState(containerManager,
-        createContainerId(0), ContainerState.DONE, 40);
+    BaseContainerManagerTest.waitForNMContainerState(
+        containerManager, createContainerId(0),
+            Arrays.asList(ContainerState.DONE,
+                ContainerState.CONTAINER_CLEANEDUP_AFTER_KILL), 40);
     Thread.sleep(5000);
 
     // Get container statuses. Container 0 should be killed, container 1


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message