kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ij...@apache.org
Subject kafka git commit: KAFKA-5792; Fix Transient failure in KafkaAdminClientTest.testHandleTimeout
Date Sat, 09 Sep 2017 07:37:24 GMT
Repository: kafka
Updated Branches:
  refs/heads/0.11.0 4a4b883d1 -> b53b7fc6e


KAFKA-5792; Fix Transient failure in KafkaAdminClientTest.testHandleTimeout

Author: Colin P. Mccabe <cmccabe@confluent.io>

Reviewers: Ismael Juma <ismael@juma.me.uk>

Closes #3822 from cmccabe/KAFKA-5792

(cherry picked from commit ae4100f82c13b3e6978c0a0f697312bd073e0eb3)
Signed-off-by: Ismael Juma <ismael@juma.me.uk>


Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/b53b7fc6
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/b53b7fc6
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/b53b7fc6

Branch: refs/heads/0.11.0
Commit: b53b7fc6e2bf5638ce5646c6899e5ce3153cbb8c
Parents: 4a4b883
Author: Colin P. Mccabe <cmccabe@confluent.io>
Authored: Sat Sep 9 08:33:08 2017 +0100
Committer: Ismael Juma <ismael@juma.me.uk>
Committed: Sat Sep 9 08:35:25 2017 +0100

----------------------------------------------------------------------
 .../java/org/apache/kafka/clients/admin/KafkaAdminClient.java    | 4 ++++
 .../org/apache/kafka/clients/admin/KafkaAdminClientTest.java     | 2 ++
 .../org/apache/kafka/clients/admin/MockKafkaAdminClientEnv.java  | 2 +-
 3 files changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/b53b7fc6/clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java
----------------------------------------------------------------------
diff --git a/clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java b/clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java
index a7eae00..b2b7515 100644
--- a/clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java
+++ b/clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java
@@ -359,6 +359,10 @@ public class KafkaAdminClient extends AdminClient {
         thread.start();
     }
 
+    Time time() {
+        return time;
+    }
+
     @Override
     public void close(long duration, TimeUnit unit) {
         long waitTimeMs = unit.toMillis(duration);

http://git-wip-us.apache.org/repos/asf/kafka/blob/b53b7fc6/clients/src/test/java/org/apache/kafka/clients/admin/KafkaAdminClientTest.java
----------------------------------------------------------------------
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 96f7e8a..83416c6 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
@@ -324,6 +324,8 @@ public class KafkaAdminClientTest {
             env.kafkaClient().setNodeApiVersions(NodeApiVersions.create());
             env.kafkaClient().prepareMetadataUpdate(env.cluster(), Collections.<String>emptySet());
             env.kafkaClient().setNode(nodes.get(0));
+            assertEquals(time, env.time());
+            assertEquals(env.time(), ((KafkaAdminClient) env.adminClient()).time());
 
             // Make a request with an extremely short timeout.
             // Then wait for it to fail by not supplying any response.

http://git-wip-us.apache.org/repos/asf/kafka/blob/b53b7fc6/clients/src/test/java/org/apache/kafka/clients/admin/MockKafkaAdminClientEnv.java
----------------------------------------------------------------------
diff --git a/clients/src/test/java/org/apache/kafka/clients/admin/MockKafkaAdminClientEnv.java
b/clients/src/test/java/org/apache/kafka/clients/admin/MockKafkaAdminClientEnv.java
index 6648467..9190da2 100644
--- a/clients/src/test/java/org/apache/kafka/clients/admin/MockKafkaAdminClientEnv.java
+++ b/clients/src/test/java/org/apache/kafka/clients/admin/MockKafkaAdminClientEnv.java
@@ -52,7 +52,7 @@ public class MockKafkaAdminClientEnv implements AutoCloseable {
     }
 
     public MockKafkaAdminClientEnv(Time time, Cluster cluster, Map<String, Object>
config) {
-        this.time = Time.SYSTEM;
+        this.time = time;
         this.adminClientConfig = new AdminClientConfig(config);
         this.cluster = cluster;
         this.metadata = new Metadata(adminClientConfig.getLong(AdminClientConfig.RETRY_BACKOFF_MS_CONFIG),


Mime
View raw message