hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jl...@apache.org
Subject hadoop git commit: YARN-7849. TestMiniYarnClusterNodeUtilization#testUpdateNodeUtilization fails due to heartbeat sync error. Contributed by Botong Huang
Date Mon, 05 Feb 2018 23:32:42 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2.9 e78a70168 -> e73e820d2


YARN-7849. TestMiniYarnClusterNodeUtilization#testUpdateNodeUtilization fails due to heartbeat
sync error. Contributed by Botong Huang

(cherry picked from commit 60656bcecadd80e28c81bc943b44abf13d20abae)


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

Branch: refs/heads/branch-2.9
Commit: e73e820d2ad36bc21bc5aa86e53e1022440d99d4
Parents: e78a701
Author: Jason Lowe <jlowe@apache.org>
Authored: Mon Feb 5 17:16:04 2018 -0600
Committer: Jason Lowe <jlowe@apache.org>
Committed: Mon Feb 5 17:29:49 2018 -0600

----------------------------------------------------------------------
 .../hadoop/yarn/server/MiniYARNCluster.java     |  5 ++---
 .../TestMiniYarnClusterNodeUtilization.java     | 20 +++-----------------
 2 files changed, 5 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/e73e820d/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/MiniYARNCluster.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/MiniYARNCluster.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/MiniYARNCluster.java
index 9834b3a..1638d55 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/MiniYARNCluster.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/MiniYARNCluster.java
@@ -636,9 +636,8 @@ public class MiniYARNCluster extends CompositeService {
       if(nodeStatus == null) {
         return currentStatus;
       } else {
-        // Increment response ID, the RMNodeStatusEvent will not get recorded
-        // for a duplicate heartbeat
-        nodeStatus.setResponseId(nodeStatus.getResponseId() + 1);
+        // Use the same responseId for the custom node status
+        nodeStatus.setResponseId(currentStatus.getResponseId());
         return nodeStatus;
       }
     }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/e73e820d/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/TestMiniYarnClusterNodeUtilization.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/TestMiniYarnClusterNodeUtilization.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/TestMiniYarnClusterNodeUtilization.java
index a941302..d1ccc9a 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/TestMiniYarnClusterNodeUtilization.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/TestMiniYarnClusterNodeUtilization.java
@@ -32,9 +32,6 @@ import org.apache.hadoop.yarn.api.records.ResourceUtilization;
 import org.apache.hadoop.yarn.conf.YarnConfiguration;
 import org.apache.hadoop.yarn.exceptions.YarnException;
 import org.apache.hadoop.yarn.server.MiniYARNCluster.CustomNodeManager;
-import org.apache.hadoop.yarn.server.api.ResourceTracker;
-import org.apache.hadoop.yarn.server.api.ServerRMProxy;
-import org.apache.hadoop.yarn.server.api.protocolrecords.NodeHeartbeatRequest;
 import org.apache.hadoop.yarn.server.api.records.NodeHealthStatus;
 import org.apache.hadoop.yarn.server.api.records.NodeStatus;
 import org.apache.hadoop.yarn.server.nodemanager.NodeStatusUpdater;
@@ -87,8 +84,7 @@ public class TestMiniYarnClusterNodeUtilization {
     assertFalse("RM never turned active", -1 == cluster.getActiveRMIndex());
 
     nm = (CustomNodeManager)cluster.getNodeManager(0);
-    int responseId = 1;
-    nodeStatus = createNodeStatus(nm.getNMContext().getNodeId(), responseId,
+    nodeStatus = createNodeStatus(nm.getNMContext().getNodeId(), 0,
         CONTAINER_PMEM_1, CONTAINER_VMEM_1, CONTAINER_CPU_1,
         NODE_PMEM_1, NODE_VMEM_1, NODE_CPU_1);
     nm.setNodeStatus(nodeStatus);
@@ -105,23 +101,14 @@ public class TestMiniYarnClusterNodeUtilization {
     assertTrue("NMs fail to connect to the RM",
         cluster.waitForNodeManagersToConnect(10000));
 
-    // Simulate heartbeat using NodeStatus fixture
-    NodeHeartbeatRequest request =
-        NodeHeartbeatRequest.newInstance(nodeStatus, null, null, null);
-    ResourceTracker tracker =
-        ServerRMProxy.createRMProxy(conf, ResourceTracker.class);
-    tracker.nodeHeartbeat(request);
-
     // Give the heartbeat time to propagate to the RM
     verifySimulatedUtilization();
 
     // Alter utilization
-    int responseId = 10;
-    nodeStatus = createNodeStatus(nm.getNMContext().getNodeId(), responseId,
+    nodeStatus = createNodeStatus(nm.getNMContext().getNodeId(), 0,
         CONTAINER_PMEM_2, CONTAINER_VMEM_2, CONTAINER_CPU_2,
         NODE_PMEM_2, NODE_VMEM_2, NODE_CPU_2);
     nm.setNodeStatus(nodeStatus);
-    tracker.nodeHeartbeat(request);
 
     // Give the heartbeat time to propagate to the RM
     verifySimulatedUtilization();
@@ -145,8 +132,7 @@ public class TestMiniYarnClusterNodeUtilization {
     verifySimulatedUtilization();
 
     // Alter utilization
-    int responseId = 20;
-    nodeStatus = createNodeStatus(nm.getNMContext().getNodeId(), responseId,
+    nodeStatus = createNodeStatus(nm.getNMContext().getNodeId(), 0,
         CONTAINER_PMEM_2, CONTAINER_VMEM_2, CONTAINER_CPU_2,
         NODE_PMEM_2, NODE_VMEM_2, NODE_CPU_2);
     nm.setNodeStatus(nodeStatus);


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