You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by jg...@apache.org on 2020/02/12 22:45:22 UTC

[kafka] branch KAFKA-9544 created (now 20f0581)

This is an automated email from the ASF dual-hosted git repository.

jgus pushed a change to branch KAFKA-9544
in repository https://gitbox.apache.org/repos/asf/kafka.git.


      at 20f0581  KAFKA-9544; Fix flaky test `AdminClientTest.testDefaultApiTimeoutOverride`

This branch includes the following new commits:

     new 20f0581  KAFKA-9544; Fix flaky test `AdminClientTest.testDefaultApiTimeoutOverride`

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[kafka] 01/01: KAFKA-9544; Fix flaky test `AdminClientTest.testDefaultApiTimeoutOverride`

Posted by jg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jgus pushed a commit to branch KAFKA-9544
in repository https://gitbox.apache.org/repos/asf/kafka.git

commit 20f058149ef1d52ba543753c3ae4c8a815c6d057
Author: Jason Gustafson <ja...@confluent.io>
AuthorDate: Wed Feb 12 14:44:43 2020 -0800

    KAFKA-9544; Fix flaky test `AdminClientTest.testDefaultApiTimeoutOverride`
---
 .../org/apache/kafka/clients/admin/KafkaAdminClientTest.java     | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/clients/src/test/java/org/apache/kafka/clients/admin/KafkaAdminClientTest.java b/clients/src/test/java/org/apache/kafka/clients/admin/KafkaAdminClientTest.java
index ed3e8a6..bcfc40e 100644
--- a/clients/src/test/java/org/apache/kafka/clients/admin/KafkaAdminClientTest.java
+++ b/clients/src/test/java/org/apache/kafka/clients/admin/KafkaAdminClientTest.java
@@ -2631,11 +2631,14 @@ public class KafkaAdminClientTest {
             // Wait for the request to be timed out before backing off
             TestUtils.waitForCondition(() -> !env.kafkaClient().hasInFlightRequests(),
                     "Timed out waiting for inFlightRequests to be timed out");
-            time.sleep(retryBackoffMs);
 
             // Since api timeout bound is not hit, AdminClient should retry
-            TestUtils.waitForCondition(() -> env.kafkaClient().hasInFlightRequests(),
-                    "Timed out waiting for Metadata request to be sent");
+            TestUtils.waitForCondition(() -> {
+                boolean hasInflightRequests = env.kafkaClient().hasInFlightRequests();
+                if (!hasInflightRequests)
+                    time.sleep(retryBackoffMs);
+                return hasInflightRequests;
+            }, "Timed out waiting for Metadata request to be sent");
             time.sleep(requestTimeoutMs + 1);
 
             TestUtils.assertFutureThrows(result.future, TimeoutException.class);