From 21b9b024c7f57a4060d52cf7b14f65eec946bc3e Mon Sep 17 00:00:00 2001 From: Tal Levy Date: Thu, 25 Oct 2018 07:24:54 -0700 Subject: [PATCH] fix PolicyStatsTests mutateInstance (#34835) through randomization, there is a chance that the mutateInstance for PolicyStatsTests does not actually mutate the original object. This PR aims to fix this --- .../xpack/core/indexlifecycle/PolicyStatsTests.java | 4 ++-- .../elasticsearch/xpack/indexlifecycle/PolicyStatsTests.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/indexlifecycle/PolicyStatsTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/indexlifecycle/PolicyStatsTests.java index 0a9ac853c89..590e3d6952a 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/indexlifecycle/PolicyStatsTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/indexlifecycle/PolicyStatsTests.java @@ -38,10 +38,10 @@ public class PolicyStatsTests extends AbstractWireSerializingTestCase(instance.getPhaseStats()); - phaseStats.put(randomAlphaOfLengthBetween(1, 20), PhaseStatsTests.createRandomInstance()); + phaseStats.put(randomAlphaOfLengthBetween(21, 25), PhaseStatsTests.createRandomInstance()); break; case 1: - indicesManaged = randomIntBetween(1, 50); + indicesManaged = randomIntBetween(11, 50); break; default: throw new AssertionError("Illegal randomisation branch"); diff --git a/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/indexlifecycle/PolicyStatsTests.java b/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/indexlifecycle/PolicyStatsTests.java index f2a77ee9e24..5ced745c2fb 100644 --- a/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/indexlifecycle/PolicyStatsTests.java +++ b/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/indexlifecycle/PolicyStatsTests.java @@ -39,7 +39,7 @@ public class PolicyStatsTests extends AbstractWireSerializingTestCase(phaseStats); - phaseStats.put(randomAlphaOfLength(10), PhaseStatsTests.randomPhaseStats()); + phaseStats.put(randomAlphaOfLength(11), PhaseStatsTests.randomPhaseStats()); break; case 1: numberIndicesManaged += randomIntBetween(1, 10);