diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/ActionConfigStatsTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/ActionConfigStatsTests.java index eb951b1ed437b..3645dcc787bc4 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/ActionConfigStatsTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/ActionConfigStatsTests.java @@ -96,7 +96,7 @@ protected ActionConfigStats mutateInstance(ActionConfigStats instance) throws IO builder.setShrinkMaxPrimaryShardSize(randomPrimaryByteSize); break; case 8: - builder.setShrinkNumberOfShards(randomIntBetween(0, 50)); + builder.setShrinkNumberOfShards(randomValueOtherThan(instance.getShrinkNumberOfShards(), () -> randomIntBetween(0, 50))); break; default: throw new IllegalStateException("Illegal randomization branch");