Skip to content

Commit da3f14a

Browse files
authored
Fix UnassignedInfo generation in AllocationRoutedStepTests (#76684) (#76687)
This PR fixes the generation of `UnassignedInfo` in AllocationRoutedStepTests#testExecuteAllocateUnassigned to ensure that it will not trigger consistency-check assertions.
1 parent 2a66a34 commit da3f14a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/AllocationRoutedStepTests.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,6 @@ public void testExecuteAllocateNotCompleteOnlyOneCopyAllocated() throws Exceptio
302302
new ClusterStateWaitStep.Result(false, allShardsActiveAllocationInfo(0, 1)));
303303
}
304304

305-
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/76633")
306305
public void testExecuteAllocateUnassigned() throws Exception {
307306
Index index = new Index(randomAlphaOfLengthBetween(1, 20), randomAlphaOfLengthBetween(1, 20));
308307
Map<String, String> includes = AllocateActionTests.randomAllocationRoutingMap(1, 5);
@@ -330,7 +329,7 @@ public void testExecuteAllocateUnassigned() throws Exception {
330329
IndexRoutingTable.Builder indexRoutingTable = IndexRoutingTable.builder(index)
331330
.addShard(TestShardRouting.newShardRouting(new ShardId(index, 0), "node1", true, ShardRoutingState.STARTED))
332331
.addShard(TestShardRouting.newShardRouting(new ShardId(index, 1), null, null, true, ShardRoutingState.UNASSIGNED,
333-
new UnassignedInfo(randomFrom(Reason.values()), "the shard is intentionally unassigned")));
332+
TestShardRouting.randomUnassignedInfo("the shard is intentionally unassigned")));
334333

335334
logger.info("running test with routing configurations:\n\t includes: [{}]\n\t excludes: [{}]\n\t requires: [{}]",
336335
includes, excludes, requires);

0 commit comments

Comments
 (0)