jim0987795064 commented on code in PR #20068:
URL: https://github.com/apache/kafka/pull/20068#discussion_r2281994322


##########
core/src/test/scala/integration/kafka/api/PlaintextAdminIntegrationTest.scala:
##########
@@ -3034,6 +3034,21 @@ class PlaintextAdminIntegrationTest extends 
BaseAdminIntegrationTest {
     }
   }
 
+  /**
+   * Waits until the metadata for the given partition has fully propagated and 
become consistent across all brokers.
+   *
+   * @param partition The partition whose leader metadata should be verified 
across all brokers.
+   */
+  def waitForBrokerMetadataPropagation(partition: TopicPartition): Unit = {
+    while (true) {
+      val headBrokerLeaderId = 
brokers.head.metadataCache.getPartitionLeaderEndpoint(partition.topic, 
partition.partition(), listenerName).get.id()

Review Comment:
   Thanks for this suggestion, update 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: jira-unsubscr...@kafka.apache.org

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

Reply via email to