From 3f8908acfbdf65cf5290b99c4e4a8b2cbdd8cb2a Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Fri, 3 Apr 2015 18:30:14 +0200 Subject: [PATCH] Test: Not all shards maybe in a started state after the initial scroll search, but are after we do the stats call, so add ensureGreen to ensure we don't up with this discrepancy --- .../java/org/elasticsearch/search/stats/SearchStatsTests.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/test/java/org/elasticsearch/search/stats/SearchStatsTests.java b/src/test/java/org/elasticsearch/search/stats/SearchStatsTests.java index a1af36b74d1..bfc9684cb18 100644 --- a/src/test/java/org/elasticsearch/search/stats/SearchStatsTests.java +++ b/src/test/java/org/elasticsearch/search/stats/SearchStatsTests.java @@ -151,6 +151,7 @@ public class SearchStatsTests extends ElasticsearchIntegrationTest { @Test public void testOpenContexts() { createIndex("test1"); + ensureGreen("test1"); final int docs = scaledRandomIntBetween(20, 50); for (int i = 0; i < docs; i++) { client().prepareIndex("test1", "type", Integer.toString(i)).setSource("field", "value").execute().actionGet();