diff --git a/server/src/test/java/org/opensearch/cluster/routing/FailAwareWeightedRoutingTests.java b/server/src/test/java/org/opensearch/cluster/routing/FailAwareWeightedRoutingTests.java index 1ecc1b4b2c5f2..4b343b7f6046f 100644 --- a/server/src/test/java/org/opensearch/cluster/routing/FailAwareWeightedRoutingTests.java +++ b/server/src/test/java/org/opensearch/cluster/routing/FailAwareWeightedRoutingTests.java @@ -434,6 +434,12 @@ public void testUpdateFailOpenStatsForOneHealthyCopy() { boolean update = FailAwareWeightedRouting.getInstance() .updateFailOpenStatsForOneHealthyCopy(searchShardIterator, clusterState, shardRoutingA.currentNodeId()); assertTrue(update); + + ShardsIterator shardIterator = new PlainShardIterator(shardId, shardRoutings); + + update = FailAwareWeightedRouting.getInstance() + .updateFailOpenStatsForOneHealthyCopy(shardIterator, clusterState, shardRoutingA.currentNodeId()); + assertTrue(update); } public void testUpdateFailOpenStatsForWithTwoHealthyCopies() { @@ -483,6 +489,12 @@ public void testUpdateFailOpenStatsForWithTwoHealthyCopies() { boolean update = FailAwareWeightedRouting.getInstance() .updateFailOpenStatsForOneHealthyCopy(searchShardIterator, clusterState, shardRoutingA.currentNodeId()); assertFalse(update); + + ShardsIterator shardIterator = new PlainShardIterator(shardId, shardRoutings); + + update = FailAwareWeightedRouting.getInstance() + .updateFailOpenStatsForOneHealthyCopy(shardIterator, clusterState, shardRoutingA.currentNodeId()); + assertFalse(update); } public void testUpdateFailOpenStatsForOneHealthyCopyWithIgnoreWeightedRouting() { @@ -532,6 +544,12 @@ public void testUpdateFailOpenStatsForOneHealthyCopyWithIgnoreWeightedRouting() boolean update = FailAwareWeightedRouting.getInstance() .updateFailOpenStatsForOneHealthyCopy(searchShardIterator, clusterState, shardRoutingA.currentNodeId()); assertFalse(update); + + ShardsIterator shardIterator = new PlainShardIterator(shardId, shardRoutings); + + update = FailAwareWeightedRouting.getInstance() + .updateFailOpenStatsForOneHealthyCopy(shardIterator, clusterState, shardRoutingA.currentNodeId()); + assertFalse(update); } }