chia7712 commented on code in PR #15668:
URL: https://github.com/apache/kafka/pull/15668#discussion_r1554647591


##########
server-common/src/main/java/org/apache/kafka/server/util/timer/SystemTimerReaper.java:
##########
@@ -76,4 +76,17 @@ public void run() {}
         reaper.awaitShutdown();
         timer.close();
     }
+
+    // visible for testing
+    boolean isReaperShutdown() {
+        return reaper.isShutdownComplete();
+    }
+
+    // visible for testing
+    boolean isTimerShutdown() {

Review Comment:
   We should add UT for `SystemTest#close` instead of casing class here. 



##########
server-common/src/main/java/org/apache/kafka/server/util/timer/SystemTimerReaper.java:
##########
@@ -76,4 +76,17 @@ public void run() {}
         reaper.awaitShutdown();
         timer.close();
     }
+
+    // visible for testing
+    boolean isReaperShutdown() {

Review Comment:
   `isShutdown`



##########
server-common/src/test/java/org/apache/kafka/server/util/timer/SystemTimerReaperTest.java:
##########
@@ -59,4 +59,11 @@ public void testReaper() throws Exception {
             timer.close();
         }
     }
+
+    @Test
+    public void testReaperClose() throws Exception {

Review Comment:
   It seems to me the test should check two conditions after calling `close`:
   
   1. `SystemTimerReaper` is not running
   2. `SystemTimer#close` happens once



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

Reply via email to