You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2022/06/08 20:37:58 UTC

[GitHub] [kafka] cadonna commented on a diff in pull request #12200: KAFKA-10199: Implement adding standby tasks to the state updater

cadonna commented on code in PR #12200:
URL: https://github.com/apache/kafka/pull/12200#discussion_r892844817


##########
streams/src/test/java/org/apache/kafka/streams/processor/internals/DefaultStateUpdaterTest.java:
##########
@@ -163,21 +172,12 @@ public void shouldRestoreSingleActiveStatefulTask() throws Exception {
 
         stateUpdater.add(task);
 
-        final Set<StreamTask> expectedRestoredTasks = Collections.singleton(task);
-        final Set<StreamTask> restoredTasks = new HashSet<>();
-        waitForCondition(
-            () -> {
-                restoredTasks.addAll(stateUpdater.getRestoredActiveTasks(Duration.ofMillis(CALL_TIMEOUT)));
-                return restoredTasks.size() == expectedRestoredTasks.size();
-            },
-            VERIFICATION_TIMEOUT,
-            "Did not get any restored active task within the given timeout!"
-        );
-        assertTrue(restoredTasks.containsAll(expectedRestoredTasks));
-        assertEquals(expectedRestoredTasks.size(), restoredTasks.stream().filter(t -> t.state() == State.RESTORING).count());
+        verifyRestoredActiveTasks(task);
         assertTrue(stateUpdater.getAllTasks().isEmpty());
-        verify(changelogReader, atLeast(3)).restore(anyMap());
+        verify(changelogReader, times(1)).enforceRestoreActive();
+        verify(changelogReader, atLeast(1)).restore(anyMap());

Review Comment:
   I do not remember! Maybe a mistake. Reverted it to three.



-- 
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-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org