sunm2n commented on code in PR #23972:
URL: https://github.com/apache/kafka/pull/23972#discussion_r4407440948


##########
group-coordinator/src/test/java/org/apache/kafka/coordinator/group/assignor/SimpleAssignorTest.java:
##########
@@ -760,6 +760,57 @@ public void testAssignWithUnsubscribedTopicHeterogeneous() 
{
         assertEveryPartitionGetsAssignment(6, computedAssignment);
     }
 
+    @Test
+    public void testAssignWithTopicUnsubscribedByAllMembersHeterogeneous() {
+        CoordinatorMetadataImage metadataImage = new MetadataImageBuilder()
+            .addTopic(TOPIC_1_UUID, TOPIC_1_NAME, 4)
+            .addTopic(TOPIC_2_UUID, TOPIC_2_NAME, 2)
+            .addTopic(TOPIC_3_UUID, TOPIC_3_NAME, 2)
+            .buildCoordinatorMetadataImage();
+        SubscribedTopicDescriberImpl subscribedTopicMetadata = new 
SubscribedTopicDescriberImpl(
+            metadataImage
+        );
+
+        // No member subscribes to topic 2 anymore, but both members still 
have a partition of it
+        Map<String, MemberSubscriptionAndAssignmentImpl> members = new 
HashMap<>();
+        members.put(MEMBER_A, new MemberSubscriptionAndAssignmentImpl(
+            Optional.empty(),
+            Optional.empty(),
+            Set.of(TOPIC_1_UUID),
+            new Assignment(mkAssignment(
+                mkTopicAssignment(TOPIC_1_UUID, 0),
+                mkTopicAssignment(TOPIC_2_UUID, 0)))
+        ));
+        members.put(MEMBER_B, new MemberSubscriptionAndAssignmentImpl(
+            Optional.empty(),
+            Optional.empty(),
+            Set.of(TOPIC_1_UUID, TOPIC_3_UUID),
+            new Assignment(mkAssignment(
+                mkTopicAssignment(TOPIC_1_UUID, 1),
+                mkTopicAssignment(TOPIC_2_UUID, 1)))
+        ));
+
+        GroupSpec groupSpec = new GroupSpecImpl(metadataImage, members, 
HETEROGENEOUS);

Review Comment:
   Thanks @squah-confluent. #23896 looks close, so if it merges first I'll 
rebase and switch the new test to ShareGroupSpecImpl



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

Reply via email to