smjn commented on code in PR #22603:
URL: https://github.com/apache/kafka/pull/22603#discussion_r3482000508


##########
share-coordinator/src/test/java/org/apache/kafka/coordinator/share/ShareCoordinatorServiceTest.java:
##########
@@ -2058,14 +2051,86 @@ public void 
testPeriodicJobsDoNotRunWhenShareGroupsDisabled() throws Interrupted
             eq("snapshot-cold-partitions"),
             any()
         );
-        assertFalse(service.shouldRunPeriodicJob());
-
         timer.advanceClock(30001L);
         verify(timer, times(4)).add(any()); // No new additions.
 
         service.shutdown();
     }
 
+    @Test
+    public void 
testPeriodicJobsDoNotDuplicateAfterDisableEnableWithInFlightJobs() throws 
InterruptedException {
+        CoordinatorRuntime<ShareCoordinatorShard, CoordinatorRecord> runtime = 
mockRuntime();
+        PartitionWriter writer = mock(PartitionWriter.class);
+        MockTime time = new MockTime();
+        MockTimer timer = spy(new MockTimer(time));
+
+        Metrics metrics = new Metrics();
+
+        ShareCoordinatorService service = spy(new ShareCoordinatorService(
+            new LogContext(),
+            ShareCoordinatorTestConfig.testConfig(),
+            runtime,
+            new ShareCoordinatorMetrics(metrics),
+            time,
+            timer,
+            writer
+        ));
+
+        CompletableFuture<Optional<Long>> firstPruneFuture = new 
CompletableFuture<>();
+        CompletableFuture<Optional<Long>> secondPruneFuture = new 
CompletableFuture<>();
+        CompletableFuture<Void> firstSnapshotFuture = new 
CompletableFuture<>();
+        CompletableFuture<Void> secondSnapshotFuture = new 
CompletableFuture<>();

Review Comment:
   same here



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