clolov commented on code in PR #15261:
URL: https://github.com/apache/kafka/pull/15261#discussion_r1466405733
##########
streams/src/test/java/org/apache/kafka/streams/processor/internals/TaskManagerTest.java:
##########
@@ -2358,6 +2354,7 @@ public void
shouldCloseActiveUnassignedSuspendedTasksWhenClosingRevokedTasks() {
assertThat(taskManager.activeTaskMap(), Matchers.anEmptyMap());
assertThat(taskManager.standbyTaskMap(), Matchers.anEmptyMap());
Mockito.verify(activeTaskCreator).closeAndRemoveTaskProducerIfNeeded(taskId00);
+ Mockito.verify(mockitoConsumer).resume(assignment);
Review Comment:
There are quite a few tests where this verification did not hold true. By
spot-checking this in EasyMock the tests appeared to pass without this change
there as well.
##########
streams/src/test/java/org/apache/kafka/streams/processor/internals/TaskManagerTest.java:
##########
@@ -4821,8 +4911,10 @@ private Map<TaskId, StateMachineTask>
handleAssignment(final Map<TaskId, Set<Top
when(standbyTaskCreator.createTasks(standbyAssignment)).thenReturn(standbyTasks);
when(activeTaskCreator.createTasks(any(),
Mockito.eq(allActiveTasksAssignment))).thenReturn(allActiveTasks);
- expectRestoreToBeCompleted(consumer);
- replay(consumer);
+ final Set<TopicPartition> assignment = singleton(new
TopicPartition("assignment", 0));
+ lenient().when(mockitoConsumer.assignment()).thenReturn(assignment);
Review Comment:
`lenient()` was needed here because this method is a dependency on quite a
few tests some of which do not actually call this. The tests which do not call
it are
* `shouldClassifyExistingTasksWithoutStateUpdater`
* `shouldComputeOffsetSumForNonRunningActiveTask`
* `shouldSkipUnknownOffsetsWhenComputingOffsetSum`
* `shouldReportLatestOffsetAsOffsetSumForRunningTask`
--
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]