HDDS-1410. TestSCMNodeMetrics is flaky. Contributed by Siddharth Wagle.

This commit is contained in:
Arpit Agarwal 2019-04-11 15:14:28 -07:00
parent ed3747c1cc
commit fcc7f9b32f
No known key found for this signature in database
GPG Key ID: E4B09E903FDF9E98
1 changed files with 3 additions and 3 deletions

View File

@ -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()));
}