Browse Source

KAFKA-8800: Increase poll timeout in poll[Records]UntilTrue (#7211)

If retrieving metadata during `poll(Duration)` repeatedly takes longer than the
poll timeout, we don't make progress and `waitUntilTrue` eventually times out
causing the test to fail. This behaviour differs from the older `poll(long)` that
would block until metadata retrieval had completed. The flakiness was likely
introduced when we switched from the latter to the former.

Reviewers: Ismael Juma <ismael@juma.me.uk>
pull/7220/head
Lee Dongjin 5 years ago committed by Ismael Juma
parent
commit
784f7e84ed
  1. 4
      core/src/test/scala/unit/kafka/utils/TestUtils.scala

4
core/src/test/scala/unit/kafka/utils/TestUtils.scala

@ -769,7 +769,7 @@ object TestUtils extends Logging { @@ -769,7 +769,7 @@ object TestUtils extends Logging {
msg: => String,
waitTimeMs: Long = JTestUtils.DEFAULT_MAX_WAIT_MS): Unit = {
waitUntilTrue(() => {
consumer.poll(Duration.ofMillis(50))
consumer.poll(Duration.ofMillis(100))
action()
}, msg = msg, pause = 0L, waitTimeMs = waitTimeMs)
}
@ -779,7 +779,7 @@ object TestUtils extends Logging { @@ -779,7 +779,7 @@ object TestUtils extends Logging {
msg: => String,
waitTimeMs: Long = JTestUtils.DEFAULT_MAX_WAIT_MS): Unit = {
waitUntilTrue(() => {
val records = consumer.poll(Duration.ofMillis(50))
val records = consumer.poll(Duration.ofMillis(100))
action(records)
}, msg = msg, pause = 0L, waitTimeMs = waitTimeMs)
}

Loading…
Cancel
Save