Skip to content

Commit

Permalink
Fix test logic error in FilterRewriteIT (#12327)
Browse files Browse the repository at this point in the history
Signed-off-by: bowenlan-amzn <[email protected]>
(cherry picked from commit 03e415e)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] committed Feb 15, 2024
1 parent 4c476fe commit 96e979c
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,19 +59,19 @@ public static Collection<Object[]> parameters() {
@Override
protected void setupSuiteScopeCluster() throws Exception {
assertAcked(client().admin().indices().prepareCreate("idx").get());
expected.clear();

final int segmentCount = randomIntBetween(2, 10);
final Set<Long> longTerms = new HashSet();
final int repeat = randomIntBetween(2, 10);
final Set<Long> longTerms = new HashSet<>();

final Map<String, Integer> dateTerms = new HashMap<>();
for (int i = 0; i < segmentCount; i++) {
for (int i = 0; i < repeat; i++) {
final List<IndexRequestBuilder> indexRequests = new ArrayList<>();

long longTerm;
do {
longTerm = randomInt(segmentCount * 2);
longTerm = randomInt(repeat * 2);
} while (!longTerms.add(longTerm));
ZonedDateTime time = ZonedDateTime.of(2024, 1, ((int) longTerm % 20) + 1, 0, 0, 0, 0, ZoneOffset.UTC);
ZonedDateTime time = ZonedDateTime.of(2024, 1, ((int) longTerm) + 1, 0, 0, 0, 0, ZoneOffset.UTC);
String dateTerm = DateFormatter.forPattern("yyyy-MM-dd").format(time);

final int frequency = randomBoolean() ? 1 : randomIntBetween(2, 20);
Expand Down

0 comments on commit 96e979c

Please sign in to comment.