Skip to content

Commit

Permalink
randomize snapshot restore scenario
Browse files Browse the repository at this point in the history
  • Loading branch information
idegtiarenko committed Oct 9, 2023
1 parent 0ff1032 commit 527e02b
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,12 @@ public void testIsGreenDuringSnapshotRestore() {
.setSettings(Settings.builder().put("location", randomRepoPath()))
);
clusterAdmin().prepareCreateSnapshot(repositoryName, snapshotName).setIndices(index).setWaitForCompletion(true).get();
assertAcked(indicesAdmin().prepareDelete(index));
if (randomBoolean()) {
assertAcked(indicesAdmin().prepareDelete(index));
} else {
assertAcked(indicesAdmin().prepareClose(index));
}
ensureGreen();

assertHealthDuring(equalTo(GREEN), () -> {
clusterAdmin().prepareRestoreSnapshot(repositoryName, snapshotName).setIndices(index).setWaitForCompletion(true).get();
Expand Down

0 comments on commit 527e02b

Please sign in to comment.