akshatb1 commented on a change in pull request #3325:
URL: https://github.com/apache/hadoop/pull/3325#discussion_r702626191
##########
File path:
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/src/test/java/org/apache/hadoop/yarn/server/router/TestRouterMetrics.java
##########
@@ -279,6 +279,37 @@ public void testMulipleAppsReportFailed() {
metrics.getMultipleAppsFailedRetrieved());
}
+ /**
+ * This test validates the correctness of the metric: Retrieved
getClusterMetrics
+ * multiple times successfully.
+ */
+ @Test
+ public void testSucceededGetClusterMetrics() {
+ long totalGoodBefore = metrics.getNumSucceededGetClusterMetricsRetrieved();
+ goodSubCluster.getClusterMetrics(100);
+ Assert.assertEquals(totalGoodBefore + 1,
+ metrics.getNumSucceededGetClusterMetricsRetrieved());
+ Assert.assertEquals(100,
metrics.getLatencySucceededGetClusterMetricsRetrieved(),
+ 0);
Review comment:
The last 0 is the delta for assertEquals check. `assertEquals(double,
double)` is deprecated so using with delta.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]