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();