From 65503d074563fa1066e5d7c5dc93c427624e3f25 Mon Sep 17 00:00:00 2001 From: Tor Brede Vekterli Date: Fri, 27 Mar 2020 16:14:50 +0100 Subject: Increase ZooKeeper test server tick time Tests running under heavy concurrent CI build load appear to struggle maintaining ZK sessions, causing flakiness. This is an attempt to mitigate that by bumping the ZK server's tick interval (and therefore session timeout) by 20x. According to local testing, this does not increase testing time in the common case. --- .../com/yahoo/vespa/clustercontroller/core/ZooKeeperTestServer.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/ZooKeeperTestServer.java b/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/ZooKeeperTestServer.java index 34c8fafa702..73b4163d542 100644 --- a/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/ZooKeeperTestServer.java +++ b/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/ZooKeeperTestServer.java @@ -8,6 +8,7 @@ import org.apache.zookeeper.server.ZooKeeperServer; import java.io.File; import java.io.IOException; import java.net.InetSocketAddress; +import java.time.Duration; /** * This class sets up a zookeeper server, such that we can test fleetcontroller zookeeper parts without stubbing in the client. @@ -15,7 +16,7 @@ import java.net.InetSocketAddress; public class ZooKeeperTestServer { private File zooKeeperDir; private ZooKeeperServer server; - private static final int tickTime = 100; + private static final Duration tickTime = Duration.ofMillis(2000); private NIOServerCnxnFactory factory; private static final String DIR_PREFIX = "test_fltctrl_zk"; private static final String DIR_POSTFIX = "sdir"; @@ -31,7 +32,7 @@ public class ZooKeeperTestServer { throw new IllegalStateException("Failed to create directory " + zooKeeperDir); } zooKeeperDir.deleteOnExit(); - server = new ZooKeeperServer(zooKeeperDir, zooKeeperDir, tickTime); + server = new ZooKeeperServer(zooKeeperDir, zooKeeperDir, (int)tickTime.toMillis()); final int maxcc = 10000; // max number of connections from the same client factory = new NIOServerCnxnFactory(); factory.configure(new InetSocketAddress(port), maxcc); // Use any port -- cgit v1.2.3