Test: testMinimumMasterNodes should use at least min_master_nodes unicast hosts

This commit is contained in:
Boaz Leskes 2015-04-28 13:09:00 +03:00
parent a1289b4ad5
commit 54f2a91aff
1 changed files with 3 additions and 2 deletions

View File

@ -81,8 +81,9 @@ public class ZenUnicastDiscoveryTests extends ElasticsearchIntegrationTest {
// can't be satisfied.
public void testMinimumMasterNodes() throws Exception {
int currentNumNodes = randomIntBetween(3, 5);
int currentNumOfUnicastHosts = randomIntBetween(1, currentNumNodes);
final Settings settings = ImmutableSettings.settingsBuilder().put("discovery.zen.minimum_master_nodes", currentNumNodes / 2 + 1).build();
final int min_master_nodes = currentNumNodes / 2 + 1;
int currentNumOfUnicastHosts = randomIntBetween(min_master_nodes, currentNumNodes);
final Settings settings = ImmutableSettings.settingsBuilder().put("discovery.zen.minimum_master_nodes", min_master_nodes).build();
discoveryConfig = new ClusterDiscoveryConfiguration.UnicastZen(currentNumNodes, currentNumOfUnicastHosts, settings);
List<String> nodes = internalCluster().startNodesAsync(currentNumNodes).get();