lucasbru commented on code in PR #15401:
URL: https://github.com/apache/kafka/pull/15401#discussion_r1525926407


##########
clients/src/test/java/org/apache/kafka/clients/consumer/internals/HeartbeatRequestManagerTest.java:
##########
@@ -428,9 +429,28 @@ public void testHeartbeatState() {
         assertEquals(memberId, data.memberId());
         assertEquals(0, data.memberEpoch());
         assertNull(data.instanceId());
-        assertEquals(-1, data.rebalanceTimeoutMs());
+        assertEquals(DEFAULT_MAX_POLL_INTERVAL_MS, data.rebalanceTimeoutMs());
         assertEquals(Collections.singletonList(topic), 
data.subscribedTopicNames());
-        assertNull(data.serverAssignor());
+        assertEquals(ConsumerTestBuilder.DEFAULT_REMOTE_ASSIGNOR, 
data.serverAssignor());
+        assertNull(data.topicPartitions());
+        membershipManager.onHeartbeatRequestSent();
+        assertEquals(MemberState.JOINING, membershipManager.state());
+
+        // Explicitly change the subscription when gets fenced
+        String newTopic = "topic2";
+        when(membershipManager.state()).thenReturn(MemberState.FENCED);
+        subscriptions.subscribe(Collections.singleton(newTopic), 
Optional.empty());

Review Comment:
   Hey @phong260702 . Sorry, I lost track of this PR. Feel free to ping me with 
my handle @lucasbru if that happens, I sometimes get lost in the GitHub noise.
   
   I think the point of the comment was to have a case where use 
`transitionToFenced` but _not_ update the subscription. It seems you case does 
update the subscription.



-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to