diff --git a/server/src/internalClusterTest/java/org/elasticsearch/snapshots/SharedClusterSnapshotRestoreIT.java b/server/src/internalClusterTest/java/org/elasticsearch/snapshots/SharedClusterSnapshotRestoreIT.java index 940e542ff5bad..0f5df5350c117 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/snapshots/SharedClusterSnapshotRestoreIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/snapshots/SharedClusterSnapshotRestoreIT.java @@ -2803,11 +2803,10 @@ public void testGetSnapshotsRequest() throws Exception { // take initial snapshot with a block, making sure we only get 1 in-progress snapshot returned // block a node so the create snapshot operation can remain in progress final String initialBlockedNode = blockNodeWithIndex(repositoryName, indexName); - ActionFuture responseListener = - client.admin().cluster().prepareCreateSnapshot(repositoryName, "snap-on-empty-repo") + client.admin().cluster().prepareCreateSnapshot(repositoryName, "snap-on-empty-repo") .setWaitForCompletion(false) .setIndices(indexName) - .execute(); + .get(); waitForBlock(initialBlockedNode, repositoryName, TimeValue.timeValueSeconds(60)); // wait for block to kick in getSnapshotsResponse = client.admin().cluster() .prepareGetSnapshots("test-repo") @@ -2816,7 +2815,6 @@ public void testGetSnapshotsRequest() throws Exception { assertEquals(1, getSnapshotsResponse.getSnapshots("test-repo").size()); assertEquals("snap-on-empty-repo", getSnapshotsResponse.getSnapshots("test-repo").get(0).snapshotId().getName()); unblockNode(repositoryName, initialBlockedNode); // unblock node - responseListener.actionGet(TimeValue.timeValueMillis(10000L)); // timeout after 10 seconds client.admin().cluster().prepareDeleteSnapshot(repositoryName, "snap-on-empty-repo").get(); final int numSnapshots = randomIntBetween(1, 3) + 1;