@@ -845,18 +845,13 @@ public void testCreateSnapshotV2() throws Exception {
845845
846846 String snapshotName2 = "test-create-snapshot2" ;
847847
848- // verify even if waitForCompletion is not true, the request executes in a sync manner
849- CreateSnapshotResponse createSnapshotResponse2 = client ().admin ()
848+ // verify response status if waitForCompletion is not true
849+ RestStatus createSnapshotResponseStatus = client ().admin ()
850850 .cluster ()
851851 .prepareCreateSnapshot (snapshotRepoName , snapshotName2 )
852- .get ();
853- snapshotInfo = createSnapshotResponse2 .getSnapshotInfo ();
854- assertThat (snapshotInfo .state (), equalTo (SnapshotState .SUCCESS ));
855- assertThat (snapshotInfo .successfulShards (), greaterThan (0 ));
856- assertThat (snapshotInfo .successfulShards (), equalTo (snapshotInfo .totalShards ()));
857- assertThat (snapshotInfo .snapshotId ().getName (), equalTo (snapshotName2 ));
858- assertThat (snapshotInfo .getPinnedTimestamp (), greaterThan (0L ));
859-
852+ .get ()
853+ .status ();
854+ assertEquals (RestStatus .ACCEPTED , createSnapshotResponseStatus );
860855 }
861856
862857 public void testMixedSnapshotCreationWithV2RepositorySetting () throws Exception {
@@ -932,6 +927,7 @@ public void testMixedSnapshotCreationWithV2RepositorySetting() throws Exception
932927 CreateSnapshotResponse createSnapshotResponse2 = client ().admin ()
933928 .cluster ()
934929 .prepareCreateSnapshot (snapshotRepoName , snapshotName2 )
930+ .setWaitForCompletion (true )
935931 .get ();
936932 snapshotInfo = createSnapshotResponse2 .getSnapshotInfo ();
937933 assertThat (snapshotInfo .state (), equalTo (SnapshotState .SUCCESS ));
@@ -993,6 +989,7 @@ public void testConcurrentSnapshotV2CreateOperation() throws InterruptedExceptio
993989 CreateSnapshotResponse createSnapshotResponse2 = client ().admin ()
994990 .cluster ()
995991 .prepareCreateSnapshot (snapshotRepoName , snapshotName )
992+ .setWaitForCompletion (true )
996993 .get ();
997994 SnapshotInfo snapshotInfo = createSnapshotResponse2 .getSnapshotInfo ();
998995 assertThat (snapshotInfo .state (), equalTo (SnapshotState .SUCCESS ));
@@ -1068,6 +1065,7 @@ public void testCreateSnapshotV2WithRedIndex() throws Exception {
10681065 CreateSnapshotResponse createSnapshotResponse2 = client ().admin ()
10691066 .cluster ()
10701067 .prepareCreateSnapshot (snapshotRepoName , snapshotName1 )
1068+ .setWaitForCompletion (true )
10711069 .get ();
10721070 SnapshotInfo snapshotInfo = createSnapshotResponse2 .getSnapshotInfo ();
10731071 assertThat (snapshotInfo .state (), equalTo (SnapshotState .SUCCESS ));
@@ -1136,6 +1134,7 @@ public void testCreateSnapshotV2WithIndexingLoad() throws Exception {
11361134 CreateSnapshotResponse createSnapshotResponse2 = client ().admin ()
11371135 .cluster ()
11381136 .prepareCreateSnapshot (snapshotRepoName , snapshotName1 )
1137+ .setWaitForCompletion (true )
11391138 .get ();
11401139
11411140 SnapshotInfo snapshotInfo = createSnapshotResponse2 .getSnapshotInfo ();
@@ -1256,6 +1255,7 @@ public void testClusterManagerFailoverDuringSnapshotCreation() throws Exception
12561255 CreateSnapshotResponse createSnapshotResponse = client ().admin ()
12571256 .cluster ()
12581257 .prepareCreateSnapshot (snapshotRepoName , snapshotName1 )
1258+ .setWaitForCompletion (true )
12591259 .get ();
12601260 snapshotInfo [0 ] = createSnapshotResponse .getSnapshotInfo ();
12611261
0 commit comments