[TEST] Reduce the number of docs per indexRandom in FieldSortIT#testIssue6614

This commit is contained in:
Simon Willnauer 2016-09-15 22:54:47 +02:00
parent 8c12b7c3b6
commit 1e2ef192c9
1 changed files with 4 additions and 2 deletions

View File

@ -126,6 +126,7 @@ public class FieldSortIT extends ESIntegTestCase {
List<IndexRequestBuilder> builders = new ArrayList<>(); List<IndexRequestBuilder> builders = new ArrayList<>();
boolean strictTimeBasedIndices = randomBoolean(); boolean strictTimeBasedIndices = randomBoolean();
final int numIndices = randomIntBetween(2, 25); // at most 25 days in the month final int numIndices = randomIntBetween(2, 25); // at most 25 days in the month
int docs = 0;
for (int i = 0; i < numIndices; i++) { for (int i = 0; i < numIndices; i++) {
final String indexId = strictTimeBasedIndices ? "idx_" + i : "idx"; final String indexId = strictTimeBasedIndices ? "idx_" + i : "idx";
if (strictTimeBasedIndices || i == 0) { if (strictTimeBasedIndices || i == 0) {
@ -141,9 +142,10 @@ public class FieldSortIT extends ESIntegTestCase {
String.format(Locale.ROOT, "%02d", j+1) + String.format(Locale.ROOT, "%02d", j+1) +
":00:00")); ":00:00"));
} }
indexRandom(true, builders);
docs += builders.size();
builders.clear();
} }
int docs = builders.size();
indexRandom(true, builders);
SearchResponse allDocsResponse = client().prepareSearch().setQuery( SearchResponse allDocsResponse = client().prepareSearch().setQuery(
QueryBuilders.boolQuery().must(QueryBuilders.termQuery("foo", "bar")).must( QueryBuilders.boolQuery().must(QueryBuilders.termQuery("foo", "bar")).must(
QueryBuilders.rangeQuery("timeUpdated").gte("2014/0" + randomIntBetween(1, 7) + "/01"))) QueryBuilders.rangeQuery("timeUpdated").gte("2014/0" + randomIntBetween(1, 7) + "/01")))