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


##########
core/src/test/scala/integration/kafka/api/PlaintextAdminIntegrationTest.scala:
##########
@@ -2864,6 +2864,15 @@ class PlaintextAdminIntegrationTest extends 
BaseAdminIntegrationTest {
     val partition2 = new TopicPartition("elect-preferred-leaders-topic-2", 0)
     createTopicWithAssignment(partition2.topic, Map[Int, 
Seq[Int]](partition2.partition -> prefer0))
 
+    def sleepMillis(durationMs: Long): Unit = {
+      val startTime = System.currentTimeMillis()
+        TestUtils.waitUntilTrue(
+          () => System.currentTimeMillis() - startTime >= durationMs,
+          s"Waited less than $durationMs ms",
+          durationMs
+        )
+    }

Review Comment:
   Just out of curiosity, why do we need this method instead of using 
`TimeUnit.MILLISECONDS.sleep()`?



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