From 527e02b20f81b20000f20a281f2470d3635b6395 Mon Sep 17 00:00:00 2001 From: "ievgen.degtiarenko" Date: Mon, 9 Oct 2023 11:57:30 +0200 Subject: [PATCH] randomize snapshot restore scenario --- .../ShardsAvailabilityHealthIndicatorServiceIT.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/server/src/internalClusterTest/java/org/elasticsearch/cluster/routing/allocation/ShardsAvailabilityHealthIndicatorServiceIT.java b/server/src/internalClusterTest/java/org/elasticsearch/cluster/routing/allocation/ShardsAvailabilityHealthIndicatorServiceIT.java index e9f7f3b238e4..ba96f77166e9 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/cluster/routing/allocation/ShardsAvailabilityHealthIndicatorServiceIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/cluster/routing/allocation/ShardsAvailabilityHealthIndicatorServiceIT.java @@ -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();