[test] wait until master actually has applied cluster state that contains second node

If we don't wait we might retrieve the cluster state before second node
was added when we try to add the delegate in which the discovery node for
node_2 is null.
This commit is contained in:
Britta Weber 2015-09-14 18:56:40 +02:00
parent 20f757c187
commit 6ea6876839
1 changed files with 2 additions and 0 deletions

View File

@ -179,6 +179,8 @@ public class IndicesStoreIntegrationIT extends ESIntegTestCase {
assertThat(Files.exists(indexDirectory(node_1, "test")), equalTo(true));
final String node_2 = internalCluster().startDataOnlyNode(Settings.builder().build());
assertFalse(client().admin().cluster().prepareHealth().setWaitForNodes("2").get().isTimedOut());
assertThat(Files.exists(shardDirectory(node_1, "test", 0)), equalTo(true));
assertThat(Files.exists(indexDirectory(node_1, "test")), equalTo(true));
assertThat(Files.exists(shardDirectory(node_2, "test", 0)), equalTo(false));