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)
This commit is contained in:
Martijn van Groningen 2015-03-02 22:41:16 +01:00
parent 7f6c65bf8e
commit ca50221474
1 changed files with 3 additions and 3 deletions

View File

@ -789,7 +789,7 @@ public class DiscoveryWithServiceDisruptionsTests extends ElasticsearchIntegrati
@Test @Test
@TestLogging("discovery.zen:TRACE,cluster.service:TRACE") @TestLogging("discovery.zen:TRACE,cluster.service:TRACE")
public void isolatedUnicastNodes() throws Exception { public void isolatedUnicastNodes() throws Exception {
List<String> nodes = startUnicastCluster(3, new int[]{0}, -1); List<String> nodes = startUnicastCluster(4, new int[]{0}, -1);
// Figure out what is the elected master node // Figure out what is the elected master node
final String unicastTarget = nodes.get(0); final String unicastTarget = nodes.get(0);
@ -813,13 +813,13 @@ public class DiscoveryWithServiceDisruptionsTests extends ElasticsearchIntegrati
setDisruptionScheme(networkDisconnect); setDisruptionScheme(networkDisconnect);
networkDisconnect.startDisrupting(); networkDisconnect.startDisrupting();
// Wait until elected master has removed that the unlucky node... // 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 // The isolate master node must report no master, so it starts with pinging
assertNoMaster(unicastTarget); assertNoMaster(unicastTarget);
networkDisconnect.stopDisrupting(); networkDisconnect.stopDisrupting();
// Wait until the master node sees all 3 nodes again. // Wait until the master node sees all 3 nodes again.
ensureStableCluster(3); ensureStableCluster(4);
} }