github-code-scanning[bot] commented on code in PR #14831:
URL: https://github.com/apache/druid/pull/14831#discussion_r1295068180


##########
server/src/test/java/org/apache/druid/server/coordinator/duty/KillUnusedSegmentsTest.java:
##########
@@ -234,14 +244,60 @@
     mockTaskSlotUsage(1.0, Integer.MAX_VALUE, 1, 10);
     // Only 1 unused segment is killed
     runAndVerifyKillInterval(yearOldSegment.getInterval());
+    verifyState(ImmutableMap.of(DATASOURCE, 
yearOldSegment.getInterval().getEnd()));
     verifyStats(9, 1, 10);
   }
 
+  @Test
+  public void testMultipleRuns()
+  {
+    Mockito.doReturn(true)
+        .when(config).getCoordinatorKillIgnoreDurationToRetain();
+    Mockito.doReturn(1)
+        .when(config).getCoordinatorKillMaxSegments();
+    Mockito.doReturn(2)
+        .when(config).getCoordinatorKillMaxSegments();
+    Mockito.doReturn(null)
+        .when(config).getCoordinatorKillPeriod();
+    target = new KillUnusedSegments(segmentsMetadataManager, overlordClient, 
config);
+
+    // All future and past unused segments are killed
+    Interval expectedKillInterval = new Interval(
+        yearOldSegment.getInterval().getStart(),
+        nextMonthSegment.getInterval().getEnd()
+    );

Review Comment:
   ## Unread local variable
   
   Variable 'Interval expectedKillInterval' is never read.
   
   [Show more 
details](https://github.com/apache/druid/security/code-scanning/5678)



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

Reply via email to