[TEST] wait for green before deleting mapping

This commit is contained in:
Shay Banon 2014-07-13 17:17:14 +09:00
parent 5e3742762a
commit fb6d847aac
1 changed files with 3 additions and 1 deletions

View File

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