summaryrefslogtreecommitdiffstats
path: root/clustercontroller-core
diff options
context:
space:
mode:
authorTor Brede Vekterli <vekterli@verizonmedia.com>2020-03-27 16:14:50 +0100
committerTor Brede Vekterli <vekterli@verizonmedia.com>2020-03-27 16:14:50 +0100
commit65503d074563fa1066e5d7c5dc93c427624e3f25 (patch)
treef65b262901ef719a91df89f93ee8f5d3c30a57f5 /clustercontroller-core
parent14f2bda51b20abb1112d627621db46e282a4b34c (diff)
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.
Diffstat (limited to 'clustercontroller-core')
-rw-r--r--clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/ZooKeeperTestServer.java5
1 files 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