You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by jd...@apache.org on 2017/01/31 22:46:08 UTC

kudu git commit: Fix flakiness of TestConnectionCache

Repository: kudu
Updated Branches:
  refs/heads/master 269e00f86 -> 99b9bf3b4


Fix flakiness of TestConnectionCache

This test would fail if one of the masters was a bit slow in starting. I
reproduced the failure reliably by adding a 3-second sleep in
ServerBase::Start.

This patch just makes a first dummy call that by design ensures that the
masters are available before we start pinging them.

Change-Id: Ib5061c002132901d9d1aab50400a7bdac4bc87d3
Reviewed-on: http://gerrit.cloudera.org:8080/5803
Tested-by: Kudu Jenkins
Reviewed-by: Adar Dembo <ad...@cloudera.com>


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

Branch: refs/heads/master
Commit: 99b9bf3b4949d889cc68123253f575022164d49b
Parents: 269e00f
Author: Todd Lipcon <to...@apache.org>
Authored: Thu Jan 26 13:40:42 2017 -0800
Committer: Jean-Daniel Cryans <jd...@apache.org>
Committed: Tue Jan 31 22:45:55 2017 +0000

----------------------------------------------------------------------
 .../test/java/org/apache/kudu/client/TestConnectionCache.java | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/99b9bf3b/java/kudu-client/src/test/java/org/apache/kudu/client/TestConnectionCache.java
----------------------------------------------------------------------
diff --git a/java/kudu-client/src/test/java/org/apache/kudu/client/TestConnectionCache.java b/java/kudu-client/src/test/java/org/apache/kudu/client/TestConnectionCache.java
index c822d79..57eceef 100644
--- a/java/kudu-client/src/test/java/org/apache/kudu/client/TestConnectionCache.java
+++ b/java/kudu-client/src/test/java/org/apache/kudu/client/TestConnectionCache.java
@@ -38,12 +38,17 @@ public class TestConnectionCache {
 
       List<HostAndPort> addresses = cluster.getMasterHostPorts();
 
+      // Below we ping the masters directly using TabletClient, so if they aren't ready to process
+      // RPCs we'll get an error. Here by listing the tables we make sure this won't happen since
+      // it won't return until a master leader is found.
+      client.getTablesList().join();
+
       ConnectionCache cache = new ConnectionCache(client);
       int i = 0;
       for (HostAndPort hp : addresses) {
+        // Ping the process so we go through the whole connection process.
         TabletClient conn =
             cache.newClient(new ServerInfo(i + "", hp.getHostText(), hp.getPort(), false));
-        // Ping the process so we go through the whole connection process.
         pingConnection(conn);
         i++;
       }