diff --git a/muted-tests.yml b/muted-tests.yml index 80e07304303e3..a1f70f9ed89c7 100644 --- a/muted-tests.yml +++ b/muted-tests.yml @@ -588,9 +588,6 @@ tests: - class: org.elasticsearch.xpack.esql.CsvIT method: test {csv-spec:change_point.values null column} issue: https://github.com/elastic/elasticsearch/issues/154877 -- class: org.elasticsearch.cluster.routing.ShardRoutingTests - method: testEqualsIgnoringVersion - issue: https://github.com/elastic/elasticsearch/issues/154886 - class: org.elasticsearch.xpack.core.ml.datafeed.DatafeedUpdateTests method: testIsUserInitiatedProjectRoutingChangeWhenRoutingNarrowsShouldReturnTrue issue: https://github.com/elastic/elasticsearch/issues/154908 diff --git a/server/src/test/java/org/elasticsearch/cluster/routing/ShardRoutingTests.java b/server/src/test/java/org/elasticsearch/cluster/routing/ShardRoutingTests.java index 22d9ac426ed3e..883b4aff57f2e 100644 --- a/server/src/test/java/org/elasticsearch/cluster/routing/ShardRoutingTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/routing/ShardRoutingTests.java @@ -392,6 +392,8 @@ public void testEqualsIgnoringVersion() { if (otherRouting.started()) { unchanged = true; } else { + final var originalState = otherRouting.state(); + final var originalRelocatingNodeId = otherRouting.relocatingNodeId(); otherRouting = new ShardRouting( otherRouting.shardId(), otherRouting.currentNodeId(), @@ -399,7 +401,10 @@ public void testEqualsIgnoringVersion() { otherRouting.primary(), otherRouting.state(), otherRouting.recoverySource(), - TestShardRouting.buildRecoveryPriority(otherRouting.state(), otherRouting.relocatingNodeId() != null), + randomValueOtherThan( + otherRouting.recoveryPriority(), + () -> TestShardRouting.buildRecoveryPriority(originalState, originalRelocatingNodeId != null) + ), otherRouting.unassignedInfo(), otherRouting.relocationFailureInfo(), otherRouting.allocationId(), @@ -449,6 +454,7 @@ public void testEqualsIgnoringVersion() { otherRouting.primary(), otherRouting.state() ).withRelocatingNodeId(otherRouting.relocatingNodeId()) + .withRecoveryPriority(otherRouting.recoveryPriority()) .withUnassignedInfo( otherRouting.unassignedInfo() == null ? new UnassignedInfo(UnassignedInfo.Reason.INDEX_CREATED, "test")