diff --git a/muted-tests.yml b/muted-tests.yml index f7dc45228aa62..f275e2cec5267 100644 --- a/muted-tests.yml +++ b/muted-tests.yml @@ -579,9 +579,6 @@ tests: - class: org.elasticsearch.xpack.remotecluster.CrossClusterEsqlRCS2UnavailableRemotesIT method: testEsqlRcs2UnavailableRemoteScenarios issue: https://github.com/elastic/elasticsearch/issues/136493 -- class: org.elasticsearch.xpack.core.HealthApiFeatureSetUsageTests - method: testEqualsAndHashcode - issue: https://github.com/elastic/elasticsearch/issues/136648 - class: org.elasticsearch.xpack.downsample.ILMDownsampleDisruptionIT method: testILMDownsampleRollingRestart issue: https://github.com/elastic/elasticsearch/issues/136585 diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/HealthApiFeatureSetUsageTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/HealthApiFeatureSetUsageTests.java index ff66a5d8e6caf..2118bbe897f2f 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/HealthApiFeatureSetUsageTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/HealthApiFeatureSetUsageTests.java @@ -37,9 +37,9 @@ protected HealthApiFeatureSetUsage createTestInstance() { @Override protected HealthApiFeatureSetUsage mutateInstance(HealthApiFeatureSetUsage instance) { Map originalStats = instance.stats(); - Counters newStats = randomCounters(); + Counters newStats = randomCounters(false); while (originalStats.equals(newStats.toMutableNestedMap())) { - newStats = randomCounters(); + newStats = randomCounters(false); } return new HealthApiFeatureSetUsage(true, true, newStats); } @@ -50,7 +50,11 @@ protected Writeable.Reader instanceReader() { } private Counters randomCounters() { - if (rarely()) { + return randomCounters(true); + } + + private Counters randomCounters(boolean allowNull) { + if (allowNull && rarely()) { return null; } Counters counters = new Counters();