Browse Source

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

Martijn van Groningen 10 years ago
parent
commit
3f8908acfb

+ 1 - 0
src/test/java/org/elasticsearch/search/stats/SearchStatsTests.java

@@ -151,6 +151,7 @@ public class SearchStatsTests extends ElasticsearchIntegrationTest {
     @Test
     @Test
     public void testOpenContexts() {
     public void testOpenContexts() {
         createIndex("test1");
         createIndex("test1");
+        ensureGreen("test1");
         final int docs = scaledRandomIntBetween(20, 50);
         final int docs = scaledRandomIntBetween(20, 50);
         for (int i = 0; i < docs; i++) {
         for (int i = 0; i < docs; i++) {
             client().prepareIndex("test1", "type", Integer.toString(i)).setSource("field", "value").execute().actionGet();
             client().prepareIndex("test1", "type", Integer.toString(i)).setSource("field", "value").execute().actionGet();