From a3b608d616fe8f9b8bb10bb60a97a9f39ec53a6c Mon Sep 17 00:00:00 2001 From: Jim Ferenczi Date: Mon, 16 Jul 2018 15:25:45 +0200 Subject: [PATCH] [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 --- .../elasticsearch/xpack/core/rollup/ConfigTestHelpers.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/rollup/ConfigTestHelpers.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/rollup/ConfigTestHelpers.java index 3d82ac118f503..3e4e4a84d2f8e 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/rollup/ConfigTestHelpers.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/rollup/ConfigTestHelpers.java @@ -94,7 +94,7 @@ public static DateHistoGroupConfig.Builder getDateHisto() { if (ESTestCase.randomBoolean()) { dateHistoBuilder.setDelay(new DateHistogramInterval(randomPositiveTimeValue())); } - dateHistoBuilder.setField(ESTestCase.randomAlphaOfLengthBetween(1, 10 )); + dateHistoBuilder.setField(ESTestCase.randomAlphaOfLengthBetween(5, 10)); return dateHistoBuilder; } @@ -112,8 +112,8 @@ public static TermsGroupConfig.Builder getTerms() { } public static List getFields() { - return IntStream.range(0, ESTestCase.randomIntBetween(1,10)) - .mapToObj(n -> ESTestCase.randomAlphaOfLengthBetween(1,10)) + return IntStream.range(0, ESTestCase.randomIntBetween(1, 10)) + .mapToObj(n -> ESTestCase.randomAlphaOfLengthBetween(5, 10)) .collect(Collectors.toList()); }