From 6c796369857a73607b96d7062a8cc2741f7e86e5 Mon Sep 17 00:00:00 2001 From: Britta Weber Date: Fri, 6 Mar 2015 10:42:29 +0100 Subject: [PATCH] [TEST] wait until mappings are added to cluster state to make sure they are persisted --- .../org/elasticsearch/gateway/GatewayIndexStateTests.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/test/java/org/elasticsearch/gateway/GatewayIndexStateTests.java b/src/test/java/org/elasticsearch/gateway/GatewayIndexStateTests.java index 9268eeac28f..2c44995a960 100644 --- a/src/test/java/org/elasticsearch/gateway/GatewayIndexStateTests.java +++ b/src/test/java/org/elasticsearch/gateway/GatewayIndexStateTests.java @@ -107,6 +107,10 @@ public class GatewayIndexStateTests extends ElasticsearchIntegrationTest { logger.info("--> indexing a simple document"); client().prepareIndex("test", "type1", "1").setSource("field1", "value1").execute().actionGet(); + // we need this until we have https://github.com/elasticsearch/elasticsearch/issues/8688 + // the test rarely fails else because the master does not apply the new mapping quick enough and it is lost + waitForConcreteMappingsOnAll("test", "type1", "field1"); + logger.info("--> closing test index..."); client().admin().indices().prepareClose("test").execute().actionGet();