From ea7db2bb6ad6bf91906a3deeb1f4fbb304618038 Mon Sep 17 00:00:00 2001 From: Armin Braun Date: Fri, 10 May 2019 11:59:20 +0200 Subject: [PATCH] Fix testCloseOrDeleteIndexDuringSnapshot (#42007) * This test was resulting in a `PARTIAL` instead of a `SUCCESS` state for the case of closing an index during snapshotting on 7.x * The reason for this is the changed default behaviour regarding waiting for active shards between 8.0 and 7.x * Fixed by adjusting the waiting behaviour on the close index request in the test * Closes #39828 --- .../elasticsearch/snapshots/SharedClusterSnapshotRestoreIT.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/test/java/org/elasticsearch/snapshots/SharedClusterSnapshotRestoreIT.java b/server/src/test/java/org/elasticsearch/snapshots/SharedClusterSnapshotRestoreIT.java index ee6b56e81fe..001a83710dc 100644 --- a/server/src/test/java/org/elasticsearch/snapshots/SharedClusterSnapshotRestoreIT.java +++ b/server/src/test/java/org/elasticsearch/snapshots/SharedClusterSnapshotRestoreIT.java @@ -2483,7 +2483,7 @@ public class SharedClusterSnapshotRestoreIT extends AbstractSnapshotIntegTestCas } else { logger.info("--> close index while partial snapshot is running"); closedOnPartial = true; - client.admin().indices().prepareClose("test-idx-1").get(); + client.admin().indices().prepareClose("test-idx-1").setWaitForActiveShards(ActiveShardCount.DEFAULT).get(); } } else { // non-partial snapshots do not allow close / delete operations on indices where snapshot has not been completed