hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/node/TestNodeManager.java
@Test
  public void testScmSameNodeHeartbeats() throws IOException,
      InterruptedException, TimeoutException {

    try (SCMNodeManager nodeManager = createNodeManager(getConf())) {
      nodeManager.setMinimumChillModeNodes(3);
      DatanodeDetails datanodeDetails = TestUtils
          .getDatanodeDetails(nodeManager);

      // Send 10 heartbeat from same node, and assert we never leave chill mode.
      for (int x = 0; x < 10; x++) {
        nodeManager.sendHeartbeat(datanodeDetails.getProtoBufMessage(),
            null, reportState);
      }

      GenericTestUtils.waitFor(() -> nodeManager.waitForHeartbeatProcessed(),
          100, 4 * 1000);
      assertFalse("Not enough nodes have send heartbeat to node" +
          "manager.", nodeManager.isOutOfChillMode());
    }
  }
/**
   * Asserts that many heartbeat from the same node is counted as a single
   * node.
   *
   * @throws IOException
   * @throws InterruptedException
   * @throws TimeoutException
   */
Asserts that many heartbeat from the same node is counted as a single
node.


Asserts that many heartbeat from the same node is counted as a single node .
@Test
  public void testScmSameNodeHeartbeats() throws IOException,
      InterruptedException, TimeoutException {
    try (SCMNodeManager nodeManager = createNodeManager(getConf())) {
      nodeManager.setMinimumChillModeNodes(3);
      DatanodeDetails datanodeDetails = TestUtils
          .getDatanodeDetails(nodeManager);
      for (int x = 0; x < 10; x++) {
        nodeManager.sendHeartbeat(datanodeDetails.getProtoBufMessage(),
            null, reportState);
      }
      GenericTestUtils.waitFor(() -> nodeManager.waitForHeartbeatProcessed(),
          100, 4 * 1000);
      assertFalse("Not enough nodes have send heartbeat to node" +
          "manager.", nodeManager.isOutOfChillMode());
    }
  }
@ Test public void testScmSameNodeHeartbeats ( ) throws IOException , InterruptedException , TimeoutException { try ( SCMNodeManager nodeManager = createNodeManager ( getConf ( ) ) ) { nodeManager . setMinimumChillModeNodes ( 3 ) ; DatanodeDetails datanodeDetails = TestUtils . getDatanodeDetails ( nodeManager ) ; for ( int x = 0 ; x < 10 ; x ++ ) { nodeManager . sendHeartbeat ( datanodeDetails . getProtoBufMessage ( ) , null , reportState ) ; } GenericTestUtils . waitFor ( ( ) -> nodeManager . waitForHeartbeatProcessed ( ) , 100 , 4 * 1000 ) ; assertFalse ( "Not enough nodes have send heartbeat to node" + "manager." , nodeManager . isOutOfChillMode ( ) ) ; } }
Asserts that many heartbeat from the same node is counted as a single
 node.
Asserts that many heartbeat from the same node is counted as a single node .
// Send 10 heartbeat from same node, and assert we never leave chill mode.