Skip to content

Commit

Permalink
Fix UnassignedInfo generation in AllocationRoutedStepTests (elastic#7…
Browse files Browse the repository at this point in the history
…6684) (elastic#76687)

This PR fixes the generation of `UnassignedInfo` in
AllocationRoutedStepTests#testExecuteAllocateUnassigned to
ensure that it will not trigger consistency-check assertions.
  • Loading branch information
gwbrown authored Aug 18, 2021
1 parent 2a66a34 commit da3f14a
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,6 @@ public void testExecuteAllocateNotCompleteOnlyOneCopyAllocated() throws Exceptio
new ClusterStateWaitStep.Result(false, allShardsActiveAllocationInfo(0, 1)));
}

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

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

0 comments on commit da3f14a

Please sign in to comment.