hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yu...@apache.org
Subject hadoop git commit: YARN-5876. TestResourceTrackerService#testGracefulDecommissionWithApp fails intermittently on trunk. (Robert Kanter via Yufei Gu)
Date Fri, 23 Jun 2017 20:27:37 GMT
Repository: hadoop
Updated Branches:
  refs/heads/trunk abdea2628 -> 0b7726289


YARN-5876. TestResourceTrackerService#testGracefulDecommissionWithApp fails intermittently
on trunk. (Robert Kanter via Yufei Gu)


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

Branch: refs/heads/trunk
Commit: 0b77262890d76b0a3a35fa64befc8a406bc70b27
Parents: abdea26
Author: Yufei Gu <yufei@apache.org>
Authored: Fri Jun 23 13:26:03 2017 -0700
Committer: Yufei Gu <yufei@apache.org>
Committed: Fri Jun 23 13:26:03 2017 -0700

----------------------------------------------------------------------
 .../yarn/server/resourcemanager/MockRM.java     | 27 +++++++++++++++-----
 1 file changed, 20 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/0b772628/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/MockRM.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/MockRM.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/MockRM.java
index 2ff4fb2..23009db 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/MockRM.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/MockRM.java
@@ -120,7 +120,7 @@ public class MockRM extends ResourceManager {
   private static final int SECOND = 1000;
   private static final int TIMEOUT_MS_FOR_ATTEMPT = 40 * SECOND;
   private static final int TIMEOUT_MS_FOR_APP_REMOVED = 40 * SECOND;
-  private static final int TIMEOUT_MS_FOR_CONTAINER_AND_NODE = 10 * SECOND;
+  private static final int TIMEOUT_MS_FOR_CONTAINER_AND_NODE = 20 * SECOND;
   private static final int WAIT_MS_PER_LOOP = 10;
 
   private final boolean useNullRMNodeLabelsManager;
@@ -853,9 +853,17 @@ public class MockRM extends ResourceManager {
     drainEventsImplicitly();
   }
 
+  private RMNode getRMNode(NodeId nodeId) {
+    RMNode node = getRMContext().getRMNodes().get(nodeId);
+    if (node == null) {
+      node = getRMContext().getInactiveRMNodes().get(nodeId);
+    }
+    return node;
+  }
+
   /**
    * Wait until a node has reached a specified state.
-   * The timeout is 10 seconds.
+   * The timeout is 20 seconds.
    * @param nodeId the id of a node
    * @param finalState the node state waited
    * @throws InterruptedException
@@ -864,12 +872,17 @@ public class MockRM extends ResourceManager {
   public void waitForState(NodeId nodeId, NodeState finalState)
       throws InterruptedException {
     drainEventsImplicitly();
-    RMNode node = getRMContext().getRMNodes().get(nodeId);
-    if (node == null) {
-      node = getRMContext().getInactiveRMNodes().get(nodeId);
-    }
-    Assert.assertNotNull("node shouldn't be null", node);
     int timeWaiting = 0;
+    RMNode node = getRMNode(nodeId);
+    while (node == null) {
+      if (timeWaiting >= TIMEOUT_MS_FOR_CONTAINER_AND_NODE) {
+        break;
+      }
+      node = getRMNode(nodeId);
+      Thread.sleep(WAIT_MS_PER_LOOP);
+      timeWaiting += WAIT_MS_PER_LOOP;
+    }
+    Assert.assertNotNull("node shouldn't be null (timedout)", node);
     while (!finalState.equals(node.getState())) {
       if (timeWaiting >= TIMEOUT_MS_FOR_CONTAINER_AND_NODE) {
         break;


---------------------------------------------------------------------
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