janchilling commented on code in PR #19889:
URL: https://github.com/apache/kafka/pull/19889#discussion_r2128752194


##########
streams/src/test/java/org/apache/kafka/streams/processor/internals/TaskManagerTest.java:
##########
@@ -4837,6 +4841,44 @@ public void 
shouldUseStartupTasksFromStateDirectoryAsStandbyWithStateUpdater() {
         assertEquals(Collections.singletonMap(taskId00, startupTask), 
taskManager.standbyTaskMap());
     }
 
+    @Test
+    public void shouldStartAndCleanlyShutdownStateUpdaterThread() {
+
+        final String stateUpdaterName = "test-state-updater";
+        final Metrics metrics = new Metrics(time);
+        final StreamsConfig config = new StreamsConfig(configProps());
+        final DefaultStateUpdater defaultStateUpdater =
+            new DefaultStateUpdater(stateUpdaterName, metrics, config, null, 
changeLogReader, topologyMetadata, time);
+
+        final TaskManager taskManager = new TaskManager(
+            time,
+            changeLogReader,
+            ProcessId.randomProcessId(),
+            "logPrefix",
+            activeTaskCreator,
+            standbyTaskCreator,
+            null,
+            topologyMetadata,
+            adminClient,
+            stateDirectory,
+            defaultStateUpdater,
+            null
+        );
+
+        taskManager.init();
+        assertTrue(defaultStateUpdater.isRunning());

Review Comment:
   Thanks for pointing that out.  I've updated the test accordingly.



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