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

    try (SCMNodeManager nodeManager = createNodeManager(getConf())) {
      // Send some heartbeats from different nodes.
      for (int x = 0; x < nodeManager.getMinimumChillModeNodes(); x++) {
        DatanodeDetails datanodeDetails = TestUtils.getDatanodeDetails(
            nodeManager);
        nodeManager.sendHeartbeat(datanodeDetails.getProtoBufMessage(),
            null, reportState);
      }

      // Wait for 4 seconds max.
      GenericTestUtils.waitFor(() -> nodeManager.waitForHeartbeatProcessed(),
          100, 4 * 1000);

      assertTrue("Heartbeat thread should have picked up the" +
              "scheduled heartbeats and transitioned out of chill mode.",
          nodeManager.isOutOfChillMode());
    }
  }
/**
   * Tests that Node manager handles heartbeats correctly, and comes out of
   * chill Mode.
   *
   * @throws IOException
   * @throws InterruptedException
   * @throws TimeoutException
   */
Tests that Node manager handles heartbeats correctly, and comes out of
chill Mode.


Tests that Node manager handles heartbeats correctly and comes out of chill Mode .
@Test
  public void testScmHeartbeat() throws IOException,
      InterruptedException, TimeoutException {
    try (SCMNodeManager nodeManager = createNodeManager(getConf())) {
      for (int x = 0; x < nodeManager.getMinimumChillModeNodes(); x++) {
        DatanodeDetails datanodeDetails = TestUtils.getDatanodeDetails(
            nodeManager);
        nodeManager.sendHeartbeat(datanodeDetails.getProtoBufMessage(),
            null, reportState);
      }
      GenericTestUtils.waitFor(() -> nodeManager.waitForHeartbeatProcessed(),
          100, 4 * 1000);
      assertTrue("Heartbeat thread should have picked up the" +
              "scheduled heartbeats and transitioned out of chill mode.",
          nodeManager.isOutOfChillMode());
    }
  }
@ Test public void testScmHeartbeat ( ) throws IOException , InterruptedException , TimeoutException { try ( SCMNodeManager nodeManager = createNodeManager ( getConf ( ) ) ) { for ( int x = 0 ; x < nodeManager . getMinimumChillModeNodes ( ) ; x ++ ) { DatanodeDetails datanodeDetails = TestUtils . getDatanodeDetails ( nodeManager ) ; nodeManager . sendHeartbeat ( datanodeDetails . getProtoBufMessage ( ) , null , reportState ) ; } GenericTestUtils . waitFor ( ( ) -> nodeManager . waitForHeartbeatProcessed ( ) , 100 , 4 * 1000 ) ; assertTrue ( "Heartbeat thread should have picked up the" + "scheduled heartbeats and transitioned out of chill mode." , nodeManager . isOutOfChillMode ( ) ) ; } }
Tests that Node manager handles heartbeats correctly, and comes out of
 chill Mode.
Tests that Node manager handles heartbeats correctly and comes out of chill Mode .
// Send some heartbeats from different nodes. // Wait for 4 seconds max.