From 6ea687683904926b651e5f1666e3b934d0265605 Mon Sep 17 00:00:00 2001 From: Britta Weber Date: Mon, 14 Sep 2015 18:56:40 +0200 Subject: [PATCH] [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. --- .../elasticsearch/indices/store/IndicesStoreIntegrationIT.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/src/test/java/org/elasticsearch/indices/store/IndicesStoreIntegrationIT.java b/core/src/test/java/org/elasticsearch/indices/store/IndicesStoreIntegrationIT.java index f8aba2c543d..8562b0991c2 100644 --- a/core/src/test/java/org/elasticsearch/indices/store/IndicesStoreIntegrationIT.java +++ b/core/src/test/java/org/elasticsearch/indices/store/IndicesStoreIntegrationIT.java @@ -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));