chia7712 commented on code in PR #22252:
URL: https://github.com/apache/kafka/pull/22252#discussion_r3224389034


##########
server/src/test/java/org/apache/kafka/server/TestUtils.java:
##########
@@ -181,4 +181,76 @@ public static int awaitLeaderChange(ClusterInstance 
cluster, TopicPartition tp,
 
         return newLeaderExists.get().get();
     }
+
+    /**
+     * Wait until a leader is elected for the given partition and return the 
leader broker id.
+     *
+     * @param brokers The list of brokers
+     * @param tp The topic partition to check
+     * @param timeoutMs The duration in ms to wait for the leader
+     * @return The leader broker id
+     */
+    public static int waitUntilLeaderIsKnown(

Review Comment:
   If this is used solely by FetchRequestTest, would you mind moving it into 
the test class instead?



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