From 3c1e31bfbf8ee1e0dc9563ed461e697b0713014a Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Sun, 9 Nov 2014 23:17:20 +0000 Subject: [PATCH] Test: move no master node test over to only use unicast zen discovery. On the build server there is no multicast enabled. Original commit: elastic/x-pack-elasticsearch@20eab58db1180ab20a92c0227b72b0b6d4fbcd7c --- .../java/org/elasticsearch/alerts/NoMasterNodeTests.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/test/java/org/elasticsearch/alerts/NoMasterNodeTests.java b/src/test/java/org/elasticsearch/alerts/NoMasterNodeTests.java index 78cf357ed01..994cb089941 100644 --- a/src/test/java/org/elasticsearch/alerts/NoMasterNodeTests.java +++ b/src/test/java/org/elasticsearch/alerts/NoMasterNodeTests.java @@ -19,6 +19,7 @@ import org.elasticsearch.discovery.DiscoverySettings; import org.elasticsearch.discovery.MasterNotDiscoveredException; import org.elasticsearch.discovery.zen.elect.ElectMasterService; import org.elasticsearch.test.ElasticsearchIntegrationTest; +import org.elasticsearch.test.discovery.ClusterDiscoveryConfiguration; import org.junit.Test; import static org.elasticsearch.index.query.QueryBuilders.termQuery; @@ -32,11 +33,15 @@ import static org.hamcrest.core.Is.is; @ElasticsearchIntegrationTest.ClusterScope(scope = ElasticsearchIntegrationTest.Scope.TEST, numClientNodes = 0, transportClientRatio = 0, numDataNodes = 0) public class NoMasterNodeTests extends AbstractAlertingTests { + private ClusterDiscoveryConfiguration.UnicastZen config; + @Override protected Settings nodeSettings(int nodeOrdinal) { Settings settings = super.nodeSettings(nodeOrdinal); + Settings unicastSettings = config.node(nodeOrdinal); return ImmutableSettings.builder() .put(settings) + .put(unicastSettings) .put(ElectMasterService.DISCOVERY_ZEN_MINIMUM_MASTER_NODES, 2) .put("discovery.type", "zen") .build(); @@ -44,6 +49,7 @@ public class NoMasterNodeTests extends AbstractAlertingTests { @Test public void testSimpleFailure() throws Exception { + config = new ClusterDiscoveryConfiguration.UnicastZen(2); internalTestCluster().startNodesAsync(2).get(); AlertsClientInterface alertsClient = alertClient(); createIndex("my-index");