dajac commented on a change in pull request #11688: URL: https://github.com/apache/kafka/pull/11688#discussion_r802484108
########## File path: clients/src/test/java/org/apache/kafka/clients/consumer/internals/ConsumerCoordinatorTest.java ########## @@ -1550,6 +1573,34 @@ public void testMetadataChangeTriggersRebalance() { assertTrue(coordinator.rejoinNeededOrPending()); } + @Test + public void testStaticLeaderRejoinsGroupAndCanTriggersRebalance() { + // ensure metadata is up-to-date for leader + subscriptions.subscribe(singleton(topic1), rebalanceListener); + client.updateMetadata(metadataResponse); + + client.prepareResponse(groupCoordinatorResponse(node, Errors.NONE)); + coordinator.ensureCoordinatorReady(time.timer(Long.MAX_VALUE)); + + // the leader is responsible for picking up metadata changes and forcing a group rebalance. + // note that `partitionAssignor.prepare` is not called therefore calling `partitionAssignor.assign` + // will throw a IllegalStateException. this indirectly verifies that `assign` is correctly skipped. + Map<String, List<String>> memberSubscriptions = singletonMap(consumerId, singletonList(topic1)); Review comment: Sure. Let me add another test. -- 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