From fcc7f9b32ff5fa5883bb01fad0f55b28ba17733d Mon Sep 17 00:00:00 2001 From: Arpit Agarwal Date: Thu, 11 Apr 2019 15:14:28 -0700 Subject: [PATCH] HDDS-1410. TestSCMNodeMetrics is flaky. Contributed by Siddharth Wagle. --- .../apache/hadoop/ozone/scm/node/TestSCMNodeMetrics.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/scm/node/TestSCMNodeMetrics.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/scm/node/TestSCMNodeMetrics.java index 3a8f9f0d7b..65a6357de9 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/scm/node/TestSCMNodeMetrics.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/scm/node/TestSCMNodeMetrics.java @@ -101,9 +101,9 @@ public void testNodeReportProcessing() throws InterruptedException { NodeReportProto nodeReport = NodeReportProto.newBuilder() .addStorageReport(storageReport).build(); datanode.getDatanodeStateMachine().getContext().addReport(nodeReport); - datanode.getDatanodeStateMachine().triggerHeartbeat(); - // Give some time so that SCM receives and processes the heartbeat. - Thread.sleep(100L); + cluster.getStorageContainerManager().getScmNodeManager() + .processNodeReport(datanode.getDatanodeDetails(), nodeReport); + assertCounter("NumNodeReportProcessed", nrProcessed + 1, getMetrics(SCMNodeMetrics.class.getSimpleName())); }