From a3d5cdcda8de503c17f39b38d8eafd34cc0a5a8e Mon Sep 17 00:00:00 2001 From: Simon Willnauer Date: Fri, 4 Jul 2014 09:51:47 +0200 Subject: [PATCH] [TEST] Wait for yellow since some shards might not be started In this test we only index a handful of docs so if we have more shards than docs we might fail on the `assertSearchResult` since not all shards are started but results are just fine. --- .../org/elasticsearch/search/query/ExistsMissingTests.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/java/org/elasticsearch/search/query/ExistsMissingTests.java b/src/test/java/org/elasticsearch/search/query/ExistsMissingTests.java index 3ebab0fc2a0..4b670b28c3a 100644 --- a/src/test/java/org/elasticsearch/search/query/ExistsMissingTests.java +++ b/src/test/java/org/elasticsearch/search/query/ExistsMissingTests.java @@ -89,7 +89,7 @@ public class ExistsMissingTests extends ElasticsearchIntegrationTest { for (Map source : sources) { reqs.add(client().prepareIndex("idx", "type").setSource(source)); } - indexRandom(true, reqs); + indexRandom(true, reqs); final Map expected = new LinkedHashMap(); expected.put("foo", 1); @@ -103,7 +103,7 @@ public class ExistsMissingTests extends ElasticsearchIntegrationTest { expected.put("foobar", 0); final long numDocs = client().prepareSearch("idx").execute().actionGet().getHits().totalHits(); - + ensureYellow("idx"); for (Map.Entry entry : expected.entrySet()) { final String fieldName = entry.getKey(); final int count = entry.getValue();