[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.
This commit is contained in:
parent
5249005578
commit
a3d5cdcda8
|
@ -89,7 +89,7 @@ public class ExistsMissingTests extends ElasticsearchIntegrationTest {
|
|||
for (Map<String, Object> source : sources) {
|
||||
reqs.add(client().prepareIndex("idx", "type").setSource(source));
|
||||
}
|
||||
indexRandom(true, reqs);
|
||||
indexRandom(true, reqs);
|
||||
|
||||
final Map<String, Integer> expected = new LinkedHashMap<String, Integer>();
|
||||
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<String, Integer> entry : expected.entrySet()) {
|
||||
final String fieldName = entry.getKey();
|
||||
final int count = entry.getValue();
|
||||
|
|
Loading…
Reference in New Issue