Skip to content

Commit

Permalink
Fix test coverage
Browse files Browse the repository at this point in the history
Signed-off-by: Anshu Agarwal <[email protected]>
  • Loading branch information
Anshu Agarwal committed May 27, 2023
1 parent 29c12ce commit 628a7fe
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -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);
}

}

0 comments on commit 628a7fe

Please sign in to comment.