UladzislauBlok commented on code in PR #20853:
URL: https://github.com/apache/kafka/pull/20853#discussion_r2510744470


##########
storage/src/test/java/org/apache/kafka/server/log/remote/storage/RemoteLogManagerTest.java:
##########
@@ -3399,56 +3399,52 @@ public void testEpochEntriesAsByteBuffer() throws 
Exception {
         assertEquals(expectedEpoch + " " + expectedStartOffset, 
bufferedReader.readLine());
     }
 
-    @ParameterizedTest
-    @ValueSource(booleans = {false, true})
-    public void testCopyQuota(boolean quotaExceeded) throws Exception {
-        RemoteLogManager.RLMCopyTask task = setupRLMTask(quotaExceeded);
-
-        if (quotaExceeded) {
-            // Verify that the copy operation times out, since no segments can 
be copied due to quota being exceeded
-            assertThrows(AssertionFailedError.class, () -> 
assertTimeoutPreemptively(Duration.ofMillis(200), () -> 
task.copyLogSegmentsToRemote(mockLog)));
-
-            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(quotaExceededThrottleTime, ((Double) 
avgMetric.metricValue()).longValue());
-            assertEquals(quotaExceededThrottleTime, ((Double) 
maxMetric.metricValue()).longValue());
-
-            // Verify the highest offset in remote storage is updated only once
-            ArgumentCaptor<Long> capture = ArgumentCaptor.forClass(Long.class);
-            verify(mockLog, 
times(1)).updateHighestOffsetInRemoteStorage(capture.capture());
-            // Verify the highest offset in remote storage was -1L before the 
copy started
-            assertEquals(-1L, capture.getValue());
-        } else {
-            // Verify the copy operation completes within the timeout, since 
it does not need to wait for quota availability
-            assertTimeoutPreemptively(Duration.ofMillis(1000), () -> 
task.copyLogSegmentsToRemote(mockLog));
-
-            // Verify quota check was performed
-            verify(rlmCopyQuotaManager, times(1)).getThrottleTimeMs();
-            // Verify bytes to copy was recorded with the quota manager
-            verify(rlmCopyQuotaManager, times(1)).record(10);
-
-            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"));
-            if (quotaExceeded) {
-                assertEquals(Double.NaN, avgMetric.metricValue());
-                assertEquals(Double.NaN, maxMetric.metricValue());

Review Comment:
   Remove this code, because it's dead. We already verified this value here 
https://github.com/apache/kafka/pull/20853/files#diff-b1c88902ed00a1f69231484869415b83599a711d5e95dec19c396f0a350c31d9L3414



-- 
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]

Reply via email to