mjsax commented on code in PR #22748:
URL: https://github.com/apache/kafka/pull/22748#discussion_r3667799544


##########
group-coordinator/src/test/java/org/apache/kafka/coordinator/group/GroupMetadataManagerTest.java:
##########
@@ -18992,6 +18993,82 @@ public void 
testStreamsGroupHeartbeatRejectsDuplicateTaskOffsets() {
         assertEquals(MemberTaskOffsets.EMPTY, group.taskOffsets(memberId));
     }
 
+    @Test
+    public void 
testStreamsGroupHeartbeatRefinementStepBumpsEpochWithoutRunningAssignor() {
+        String groupId = "fooup";
+        String memberId = Uuid.randomUuid().toString();
+        String subtopology1 = "subtopology1";
+        String fooTopicName = "foo";
+        Uuid fooTopicId = Uuid.randomUuid();
+        Topology topology = new Topology().setSubtopologies(List.of(
+            new 
Subtopology().setSubtopologyId(subtopology1).setSourceTopics(List.of(fooTopicName))
+        ));
+
+        CoordinatorMetadataImage metadataImage = new MetadataImageBuilder()
+            .addTopic(fooTopicId, fooTopicName, 4)
+            .buildCoordinatorMetadataImage();
+        long groupMetadataHash = computeGroupHash(Map.of(
+            fooTopicName, computeTopicHash(fooTopicName, metadataImage)
+        ));
+
+        // The member is reconciled (STABLE, at the assignment epoch), yet its 
current assignment differs from the
+        // target: it owns partitions {0,1,2} while the target assigns 
{0,1,2,3}. With the no-op refiner (which
+        // returns the target as-is), this stands in for "the refiner produced 
an intermediate assignment the member
+        // has not reconciled to yet", so the refinement predicate fires and a 
REFINE step is taken. Nothing else

Review Comment:
   Atm, the refiner is a no-op, and thus we need to stage something here, to 
trigger the control flow we want to test. Ie, we mimic a situation as if the 
refiner would have change the assignment.
   
   Let me rephrase it.



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