[TEST] properly wait for mappings when needed

This commit is contained in:
Shay Banon 2014-06-30 22:32:25 +02:00
parent 5273410be6
commit 5c5e13abce
2 changed files with 2 additions and 0 deletions

View File

@ -133,6 +133,7 @@ public class SimpleGetFieldMappingsTests extends ElasticsearchIntegrationTest {
client().prepareIndex("test", "type", "1").setSource("num", 1).get(); client().prepareIndex("test", "type", "1").setSource("num", 1).get();
ensureYellow(); ensureYellow();
waitForConcreteMappingsOnAll("test", "type", "num"); // for num, we need to wait...
GetFieldMappingsResponse response = client().admin().indices().prepareGetFieldMappings().setFields("num", "field1", "subfield").includeDefaults(true).get(); GetFieldMappingsResponse response = client().admin().indices().prepareGetFieldMappings().setFields("num", "field1", "subfield").includeDefaults(true).get();

View File

@ -1756,6 +1756,7 @@ public class PercolatorTests extends ElasticsearchIntegrationTest {
assertMatchCount(response, 0l); assertMatchCount(response, 0l);
assertThat(response.getMatches(), arrayWithSize(0)); assertThat(response.getMatches(), arrayWithSize(0));
ensureYellow("test"); // wait for at least primaries allocations so concretely allocated on it
waitForConcreteMappingsOnAll("test", "type1", "field1", "field2"); waitForConcreteMappingsOnAll("test", "type1", "field1", "field2");
GetMappingsResponse mappingsResponse = client().admin().indices().prepareGetMappings("test").get(); GetMappingsResponse mappingsResponse = client().admin().indices().prepareGetMappings("test").get();