test: changed the join timeout from the default 60s to 10s and

also wait for the cluster state to contain 4 nodes instead of just waiting for a green state.
This commit is contained in:
Martijn van Groningen 2015-08-24 13:42:29 +02:00
parent 8862348e4f
commit d7327b7b31
1 changed files with 6 additions and 2 deletions

View File

@ -22,6 +22,7 @@ package org.elasticsearch.discovery;
import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.cluster.node.DiscoveryNode;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.test.ESIntegTestCase;
import org.elasticsearch.test.ESIntegTestCase.ClusterScope;
import org.elasticsearch.test.ESIntegTestCase.Scope;
@ -81,12 +82,15 @@ public class ZenUnicastDiscoveryIT extends ESIntegTestCase {
int currentNumNodes = randomIntBetween(3, 5);
final int min_master_nodes = currentNumNodes / 2 + 1;
int currentNumOfUnicastHosts = randomIntBetween(min_master_nodes, currentNumNodes);
final Settings settings = Settings.settingsBuilder().put("discovery.zen.minimum_master_nodes", min_master_nodes).build();
final Settings settings = Settings.settingsBuilder()
.put("discovery.zen.join_timeout", TimeValue.timeValueSeconds(10))
.put("discovery.zen.minimum_master_nodes", min_master_nodes)
.build();
discoveryConfig = new ClusterDiscoveryConfiguration.UnicastZen(currentNumNodes, currentNumOfUnicastHosts, settings);
List<String> nodes = internalCluster().startNodesAsync(currentNumNodes).get();
ensureGreen();
ensureStableCluster(currentNumNodes);
DiscoveryNode masterDiscoNode = null;
for (String node : nodes) {