Test: testMinimumMasterNodes should use at least min_master_nodes unicast hosts
This commit is contained in:
parent
a1289b4ad5
commit
54f2a91aff
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue