From fb6d847aac7cbf04e7c0eb6b56dec15f68541b48 Mon Sep 17 00:00:00 2001 From: Shay Banon Date: Sun, 13 Jul 2014 17:17:14 +0900 Subject: [PATCH] [TEST] wait for green before deleting mapping --- .../elasticsearch/indices/IndicesOptionsIntegrationTests.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/test/java/org/elasticsearch/indices/IndicesOptionsIntegrationTests.java b/src/test/java/org/elasticsearch/indices/IndicesOptionsIntegrationTests.java index 7747ff03ef4..79b5b82d000 100644 --- a/src/test/java/org/elasticsearch/indices/IndicesOptionsIntegrationTests.java +++ b/src/test/java/org/elasticsearch/indices/IndicesOptionsIntegrationTests.java @@ -491,7 +491,9 @@ public class IndicesOptionsIntegrationTests extends ElasticsearchIntegrationTest assertAcked(prepareCreate("foobar").addMapping("type1", "field", "type=string")); assertAcked(prepareCreate("bar").addMapping("type1", "field", "type=string")); assertAcked(prepareCreate("barbaz").addMapping("type1", "field", "type=string")); - ensureYellow(); + // we wait for green to make sure indices with mappings have been created on all relevant + // nodes, and that recovery won't re-introduce a mapping + ensureGreen(); verify(client().admin().indices().prepareDeleteMapping("foo*").setType("type1"), false); assertThat(client().admin().indices().prepareTypesExists("foo").setTypes("type1").get().isExists(), equalTo(false));