[TEST] use existing client that is already in the cluster to wait for joining node

This commit is contained in:
Simon Willnauer 2014-07-04 12:17:47 +02:00
parent 1493ece094
commit 9f5f11c6a2
1 changed files with 3 additions and 1 deletions

View File

@ -108,15 +108,17 @@ public class CompositeTestCluster extends TestCluster {
public synchronized boolean upgradeOneNode(Settings nodeSettings) throws InterruptedException, IOException {
Collection<ExternalNode> runningNodes = runningNodes();
if (!runningNodes.isEmpty()) {
final Client existingClient = cluster.client();
ExternalNode externalNode = RandomPicks.randomFrom(random, runningNodes);
externalNode.stop();
String s = cluster.startNode(nodeSettings);
ExternalNode.waitForNode(cluster.client(), s);
ExternalNode.waitForNode(existingClient, s);
return true;
}
return false;
}
/**
* Returns the a simple pattern that matches all "new" nodes in the cluster.
*/