kamalcph commented on code in PR #20129: URL: https://github.com/apache/kafka/pull/20129#discussion_r2238259919
########## storage/src/test/java/org/apache/kafka/server/log/remote/storage/RemoteLogManagerTest.java: ########## @@ -3412,8 +3412,14 @@ public void testCopyQuota(boolean quotaExceeded) throws Exception { Map<org.apache.kafka.common.MetricName, KafkaMetric> allMetrics = metrics.metrics(); KafkaMetric avgMetric = allMetrics.get(metrics.metricName("remote-copy-throttle-time-avg", "RemoteLogManager")); KafkaMetric maxMetric = allMetrics.get(metrics.metricName("remote-copy-throttle-time-max", "RemoteLogManager")); - assertEquals(Double.NaN, avgMetric.metricValue()); - assertEquals(Double.NaN, maxMetric.metricValue()); + if (quotaExceeded) { Review Comment: shall we remove the if..else block and replace with the below asserts? ``` // Metrics are not created until they actually get recorded (e.g. if the quota is exceeded). assertNull(avgMetric); assertNull(maxMetric); ``` because the if block is unreachable. -- 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: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org