chickenchickenlove commented on code in PR #22356:
URL: https://github.com/apache/kafka/pull/22356#discussion_r3379801215
##########
group-coordinator/src/test/java/org/apache/kafka/coordinator/group/GroupMetadataManagerTest.java:
##########
@@ -14150,6 +14321,76 @@ public void
testJoiningConsumerGroupThrowsExceptionIfGroupOverMaxSize() {
assertEquals("The consumer group has reached its maximum capacity of 1
members.", ex.getMessage());
}
+ @Test
+ public void
testStaticMemberCanRejoinConsumerGroupWithClassicProtocolWhenGroupIsFull()
throws Exception {
+ String groupId = "group-id";
+ String oldMemberId = "old-member";
+ String instanceId = "instance-id";
+
+ GroupMetadataManagerTestContext context = new
GroupMetadataManagerTestContext.Builder()
+ .withConsumerGroup(new ConsumerGroupBuilder(groupId, 10)
+ .withMember(new ConsumerGroupMember.Builder(oldMemberId)
+ .setInstanceId(instanceId)
+ .setState(MemberState.STABLE)
+ .setMemberEpoch(LEAVE_GROUP_STATIC_MEMBER_EPOCH)
+ .setPreviousMemberEpoch(9)
+ .build())
+ .withAssignmentEpoch(10))
+ .withConfig(GroupCoordinatorConfig.CONSUMER_GROUP_MAX_SIZE_CONFIG,
1)
+
.withConfig(GroupCoordinatorConfig.CONSUMER_GROUP_MIGRATION_POLICY_CONFIG,
ConsumerGroupMigrationPolicy.DISABLED.toString())
+ .build();
+
+ JoinGroupRequestData request = new
GroupMetadataManagerTestContext.JoinGroupRequestBuilder()
+ .withGroupId(groupId)
+ .withMemberId(UNKNOWN_MEMBER_ID)
+ .withGroupInstanceId(instanceId)
+
.withProtocols(GroupMetadataManagerTestContext.toConsumerProtocol(List.of(),
List.of()))
+ .build();
+
+ GroupMetadataManagerTestContext.JoinResult joinResult =
context.sendClassicGroupJoin(request, true, true);
+ joinResult.appendFuture.complete(null);
Review Comment:
@dajac
I don't think we should remove it. This follows the existing test
pattern(for examplle, `testReplaceStaticMemberInStableStateSucceeds`) where we
complete the append future to simulate a successful log append before asserting
that the response future is done. Without this line, the join future is not
completed in this path.
What do you think?
--
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]