dongnuo123 commented on code in PR #16511:
URL: https://github.com/apache/kafka/pull/16511#discussion_r1671038322
##########
group-coordinator/src/test/java/org/apache/kafka/coordinator/group/GroupCoordinatorShardTest.java:
##########
@@ -993,13 +998,50 @@ public void testCleanupGroupMetadata() {
verify(groupMetadataManager,
times(0)).maybeDeleteGroup(eq("other-group-id"), any());
}
+ @Test
+ public void testCleanupGroupMetadataWhenAppendFails() {
+ GroupMetadataManager groupMetadataManager =
mock(GroupMetadataManager.class);
+ OffsetMetadataManager offsetMetadataManager =
mock(OffsetMetadataManager.class);
+ Time mockTime = new MockTime();
+ MockCoordinatorTimer<Void, CoordinatorRecord> timer = new
MockCoordinatorTimer<>(mockTime);
+ GroupCoordinatorMetricsShard metricsShard =
mock(GroupCoordinatorMetricsShard.class);
+ GroupCoordinatorShard coordinator = new GroupCoordinatorShard(
+ new LogContext(),
+ groupMetadataManager,
+ offsetMetadataManager,
+ mockTime,
+ timer,
+ mock(GroupCoordinatorConfig.class),
+ mock(CoordinatorMetrics.class),
+ metricsShard
+ );
+
+ when(groupMetadataManager.groupIds()).thenReturn(mkSet("group-id",
"other-group-id"));
+ when(offsetMetadataManager.cleanupExpiredOffsets(eq("group-id"),
eq(new ArrayList<>()))).thenReturn(true);
+ when(groupMetadataManager.maybeDeleteGroup(eq("group-id"), eq(new
ArrayList<>()))).thenReturn(true);
Review Comment:
Should we add something to the record list and assert it's non null later?
--
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]