Skip to content

Commit ac60fca

Browse files
committed
[Rollup] Fix duplicate field names in test (#32075)
This commit ensures that random field names do not clash with the explicit field names set by the tests. Closes #32067
1 parent 69e61c7 commit ac60fca

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/rollup/ConfigTestHelpers.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public static DateHistoGroupConfig.Builder getDateHisto() {
9494
if (ESTestCase.randomBoolean()) {
9595
dateHistoBuilder.setDelay(new DateHistogramInterval(randomPositiveTimeValue()));
9696
}
97-
dateHistoBuilder.setField(ESTestCase.randomAlphaOfLengthBetween(1, 10 ));
97+
dateHistoBuilder.setField(ESTestCase.randomAlphaOfLengthBetween(5, 10));
9898
return dateHistoBuilder;
9999
}
100100

@@ -112,8 +112,8 @@ public static TermsGroupConfig.Builder getTerms() {
112112
}
113113

114114
public static List<String> getFields() {
115-
return IntStream.range(0, ESTestCase.randomIntBetween(1,10))
116-
.mapToObj(n -> ESTestCase.randomAlphaOfLengthBetween(1,10))
115+
return IntStream.range(0, ESTestCase.randomIntBetween(1, 10))
116+
.mapToObj(n -> ESTestCase.randomAlphaOfLengthBetween(5, 10))
117117
.collect(Collectors.toList());
118118
}
119119

0 commit comments

Comments
 (0)