jolshan commented on code in PR #17780: URL: https://github.com/apache/kafka/pull/17780#discussion_r1841281653
########## core/src/test/scala/unit/kafka/server/ProduceRequestTest.scala: ########## @@ -84,14 +86,41 @@ class ProduceRequestTest extends BaseRequestTest { new SimpleRecord(System.currentTimeMillis(), "key2".getBytes, "value2".getBytes)), 1) } - @ParameterizedTest + private def getPartitionToLeader( + admin: Admin, + topic: String + ): Map[Int, Int] = { + var topicDescription: TopicDescription = null + TestUtils.waitUntilTrue(() => { + val topicMap = admin. + describeTopics(java.util.Arrays.asList(topic)). + allTopicNames().get(10, TimeUnit.MINUTES) + topicDescription = topicMap.get(topic) + topicDescription != null + }, "Timed out waiting to describe topic " + topic) + topicDescription.partitions().asScala.map(p => { + p.partition() -> p.leader().id() + }).toMap + } + + @ParameterizedTest(name = "quorum=kraft") Review Comment: Ok -- just wasn't sure if we also needed the quorum param. -- 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