Test: make sure mappings are on all shards to prevent false test failures

This commit is contained in:
mikemccand 2014-08-08 10:51:23 -04:00
parent 1a09e7180a
commit 5335e3d22d
1 changed files with 4 additions and 0 deletions

View File

@ -2456,6 +2456,10 @@ public class SimpleQueryTests extends ElasticsearchIntegrationTest {
refresh();
// Ensure all shards have our mappings, otherwise we can sometimes fail to hit the expected exceptions below, because some shards
// will succeed in running a query (that returns 0 hits) instead of throwing the expected exception:
waitForConcreteMappingsOnAll("test", "type1", "date", "num");
SearchResponse searchResponse = client().prepareSearch("test")
.setQuery(QueryBuilders.rangeQuery("date").from("2014-01-01T00:00:00").to("2014-01-01T00:59:00"))
.get();