From 37653c9dca1bf59574c9bdddaadc378c7d1f6337 Mon Sep 17 00:00:00 2001 From: Jim Ferenczi Date: Tue, 28 Nov 2017 16:18:03 +0100 Subject: [PATCH] [TEST] AggregationsIntegrationIT#testScroll can timeout This change sets the scroll timeout for this test to 1m instead of 500ms in order to avoid loosing the scroll on slow machines. Relates #26378 --- .../search/aggregations/AggregationsIntegrationIT.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/src/test/java/org/elasticsearch/search/aggregations/AggregationsIntegrationIT.java b/core/src/test/java/org/elasticsearch/search/aggregations/AggregationsIntegrationIT.java index b16aacd9a16..bd6298f5d03 100644 --- a/core/src/test/java/org/elasticsearch/search/aggregations/AggregationsIntegrationIT.java +++ b/core/src/test/java/org/elasticsearch/search/aggregations/AggregationsIntegrationIT.java @@ -30,6 +30,7 @@ import java.util.List; import static org.elasticsearch.search.aggregations.AggregationBuilders.terms; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; +import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse; @@ -52,7 +53,7 @@ public class AggregationsIntegrationIT extends ESIntegTestCase { public void testScroll() { final int size = randomIntBetween(1, 4); SearchResponse response = client().prepareSearch("index") - .setSize(size).setScroll(new TimeValue(500)) + .setSize(size).setScroll(TimeValue.timeValueMinutes(1)) .addAggregation(terms("f").field("f")).get(); assertSearchResponse(response); Aggregations aggregations = response.getAggregations(); @@ -63,8 +64,9 @@ public class AggregationsIntegrationIT extends ESIntegTestCase { int total = response.getHits().getHits().length; while (response.getHits().getHits().length > 0) { response = client().prepareSearchScroll(response.getScrollId()) - .setScroll(new TimeValue(500)) + .setScroll(TimeValue.timeValueMinutes(1)) .execute().actionGet(); + assertSearchResponse(response); assertNull(response.getAggregations()); total += response.getHits().getHits().length; }