From faac0d2a524aeb10002e493b97f888bdc93ad65d Mon Sep 17 00:00:00 2001 From: polyfractal Date: Fri, 2 Mar 2018 16:16:11 -0800 Subject: [PATCH] [Rollup] Don't randomize index name in test The test job helper randomizes the index name with 1-10 characters, which can lead to randomized index names to overlap and show fewer caps than the test expects. The solution is to just use index names "0"-"24" to ensure none of the names overlap, and thus the caps don't overlap. Original commit: elastic/x-pack-elasticsearch@74a6d13213c4676084cea246f58c2b1580795b24 --- .../xpack/rollup/action/GetRollupCapsActionRequestTests.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugin/rollup/src/test/java/org/elasticsearch/xpack/rollup/action/GetRollupCapsActionRequestTests.java b/plugin/rollup/src/test/java/org/elasticsearch/xpack/rollup/action/GetRollupCapsActionRequestTests.java index 471eef6cc09..289c093ef88 100644 --- a/plugin/rollup/src/test/java/org/elasticsearch/xpack/rollup/action/GetRollupCapsActionRequestTests.java +++ b/plugin/rollup/src/test/java/org/elasticsearch/xpack/rollup/action/GetRollupCapsActionRequestTests.java @@ -139,12 +139,15 @@ public class GetRollupCapsActionRequestTests extends AbstractStreamableTestCase< public void testAllIndices() throws IOException { int num = randomIntBetween(1,5); ImmutableOpenMap.Builder indices = new ImmutableOpenMap.Builder<>(5); + int indexCounter = 0; for (int j = 0; j < 5; j++) { Map jobs = new HashMap<>(num); for (int i = 0; i < num; i++) { String jobName = randomAlphaOfLength(10); - jobs.put(jobName, ConfigTestHelpers.getRollupJob(jobName).build()); + String indexName = Integer.toString(indexCounter); + indexCounter += 1; + jobs.put(jobName, ConfigTestHelpers.getRollupJob(jobName).setIndexPattern(indexName).build()); } MappingMetaData mappingMeta = new MappingMetaData(RollupField.NAME,