Skip to content

Commit

Permalink
[LI-CHERRY-PICK] [71e2019] KAFKA-8800: Increase poll timeout in poll[…
Browse files Browse the repository at this point in the history
…Records]UntilTrue (apache#7211)

TICKET = KAFKA-8800
LI_DESCRIPTION =
EXIT_CRITERIA = HASH [71e2019]
ORIGINAL_DESCRIPTION =

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 <[email protected]>
(cherry picked from commit 71e2019)
  • Loading branch information
dongjinleekr authored and xiowu0 committed Aug 21, 2019
1 parent a1732a7 commit a89170a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/src/test/scala/unit/kafka/utils/TestUtils.scala
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,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)
}
Expand All @@ -821,7 +821,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)
}
Expand Down

0 comments on commit a89170a

Please sign in to comment.