Skip to content

Commit

Permalink
add closed index scenario
Browse files Browse the repository at this point in the history
  • Loading branch information
idegtiarenko committed Oct 9, 2023
1 parent 527e02b commit 453024f
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,23 @@ public void testIsGreenDuringIndexClone() {
});
}

@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/99951")
public void testIsGreenDuringOpeningAndClosingIndex() {

internalCluster().ensureAtLeastNumDataNodes(2);

var index = randomIdentifier();
prepareCreate(index).setSettings(indexSettings(1, 1)).get();
ensureGreen(index);

assertHealthDuring(equalTo(GREEN), () -> {
indicesAdmin().prepareClose(index).get();
ensureGreen(index);
indicesAdmin().prepareClose(index).get();
ensureGreen(index);
});
}

private void assertHealthDuring(Matcher<HealthStatus> statusMatcher, Runnable action) {
var clusterService = internalCluster().getCurrentMasterNodeInstance(ClusterService.class);
var allocationService = internalCluster().getCurrentMasterNodeInstance(AllocationService.class);
Expand Down

0 comments on commit 453024f

Please sign in to comment.