showuon commented on code in PR #11681:
URL: https://github.com/apache/kafka/pull/11681#discussion_r852533776


##########
core/src/test/java/kafka/testkit/KafkaClusterTestKit.java:
##########
@@ -373,13 +373,19 @@ public void startup() throws ExecutionException, 
InterruptedException {
 
     /**
      * Wait for a controller to mark all the brokers as ready (registered and 
unfenced).
+     * And also wait for the metadata cache up-to-date in each broker server.
      */
     public void waitForReadyBrokers() throws ExecutionException, 
InterruptedException {
         // We can choose any controller, not just the active controller.
         // If we choose a standby controller, we will wait slightly longer.
         ControllerServer controllerServer = 
controllers.values().iterator().next();

Review Comment:
   @dengziming , yes, you are right, it can still work well if we remove 
`waitForReadyBrokers`. But I think it's still useful to keep it, because if we 
have test failed with "metadata cache not update in time", we can't know if all 
the brokers are ready (registered and unfenced) or not. That is, with the 
`controller.waitForReadyBrokers()`, we can make the tests better for 
troubleshooting in the future. WDYT?



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