From ca50221474ea74766e5b598e2421870644b63f4e Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Mon, 2 Mar 2015 22:41:16 +0100 Subject: [PATCH] Test: fix DiscoveryWithServiceDisruptionsTests#isolatedUnicastNodes by starting a 4 node cluster instead of a 3 node cluster. If the isolated unicast host is also a master node then its local cluster state gets unusable a source for pinging when the disruption stops. All the nodes in the cluster state node list can be removed and at that time it will only ping itself and never find out about the other nodes. (these nodes will not ping, because they are already following a new master) --- .../discovery/DiscoveryWithServiceDisruptionsTests.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/test/java/org/elasticsearch/discovery/DiscoveryWithServiceDisruptionsTests.java b/src/test/java/org/elasticsearch/discovery/DiscoveryWithServiceDisruptionsTests.java index 74762bd5086..e4d4fea410e 100644 --- a/src/test/java/org/elasticsearch/discovery/DiscoveryWithServiceDisruptionsTests.java +++ b/src/test/java/org/elasticsearch/discovery/DiscoveryWithServiceDisruptionsTests.java @@ -789,7 +789,7 @@ public class DiscoveryWithServiceDisruptionsTests extends ElasticsearchIntegrati @Test @TestLogging("discovery.zen:TRACE,cluster.service:TRACE") public void isolatedUnicastNodes() throws Exception { - List nodes = startUnicastCluster(3, new int[]{0}, -1); + List nodes = startUnicastCluster(4, new int[]{0}, -1); // Figure out what is the elected master node final String unicastTarget = nodes.get(0); @@ -813,13 +813,13 @@ public class DiscoveryWithServiceDisruptionsTests extends ElasticsearchIntegrati setDisruptionScheme(networkDisconnect); networkDisconnect.startDisrupting(); // Wait until elected master has removed that the unlucky node... - ensureStableCluster(2, nodes.get(1)); + ensureStableCluster(3, nodes.get(1)); // The isolate master node must report no master, so it starts with pinging assertNoMaster(unicastTarget); networkDisconnect.stopDisrupting(); // Wait until the master node sees all 3 nodes again. - ensureStableCluster(3); + ensureStableCluster(4); }