[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
@@ -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;
}
