@@ -839,18 +839,13 @@ public void testCreateSnapshotV2() throws Exception {
839
839
840
840
String snapshotName2 = "test-create-snapshot2" ;
841
841
842
- // verify even if waitForCompletion is not true, the request executes in a sync manner
843
- CreateSnapshotResponse createSnapshotResponse2 = client ().admin ()
842
+ // verify response status if waitForCompletion is not true
843
+ RestStatus createSnapshotResponseStatus = client ().admin ()
844
844
.cluster ()
845
845
.prepareCreateSnapshot (snapshotRepoName , snapshotName2 )
846
- .get ();
847
- snapshotInfo = createSnapshotResponse2 .getSnapshotInfo ();
848
- assertThat (snapshotInfo .state (), equalTo (SnapshotState .SUCCESS ));
849
- assertThat (snapshotInfo .successfulShards (), greaterThan (0 ));
850
- assertThat (snapshotInfo .successfulShards (), equalTo (snapshotInfo .totalShards ()));
851
- assertThat (snapshotInfo .snapshotId ().getName (), equalTo (snapshotName2 ));
852
- assertThat (snapshotInfo .getPinnedTimestamp (), greaterThan (0L ));
853
-
846
+ .get ()
847
+ .status ();
848
+ assertEquals (RestStatus .ACCEPTED , createSnapshotResponseStatus );
854
849
}
855
850
856
851
public void testMixedSnapshotCreationWithV2RepositorySetting () throws Exception {
@@ -914,6 +909,7 @@ public void testMixedSnapshotCreationWithV2RepositorySetting() throws Exception
914
909
CreateSnapshotResponse createSnapshotResponse2 = client ().admin ()
915
910
.cluster ()
916
911
.prepareCreateSnapshot (snapshotRepoName , snapshotName2 )
912
+ .setWaitForCompletion (true )
917
913
.get ();
918
914
snapshotInfo = createSnapshotResponse2 .getSnapshotInfo ();
919
915
assertThat (snapshotInfo .state (), equalTo (SnapshotState .SUCCESS ));
@@ -968,6 +964,7 @@ public void testConcurrentSnapshotV2CreateOperation() throws InterruptedExceptio
968
964
CreateSnapshotResponse createSnapshotResponse2 = client ().admin ()
969
965
.cluster ()
970
966
.prepareCreateSnapshot (snapshotRepoName , snapshotName )
967
+ .setWaitForCompletion (true )
971
968
.get ();
972
969
SnapshotInfo snapshotInfo = createSnapshotResponse2 .getSnapshotInfo ();
973
970
assertThat (snapshotInfo .state (), equalTo (SnapshotState .SUCCESS ));
@@ -1036,6 +1033,7 @@ public void testCreateSnapshotV2WithRedIndex() throws Exception {
1036
1033
CreateSnapshotResponse createSnapshotResponse2 = client ().admin ()
1037
1034
.cluster ()
1038
1035
.prepareCreateSnapshot (snapshotRepoName , snapshotName1 )
1036
+ .setWaitForCompletion (true )
1039
1037
.get ();
1040
1038
SnapshotInfo snapshotInfo = createSnapshotResponse2 .getSnapshotInfo ();
1041
1039
assertThat (snapshotInfo .state (), equalTo (SnapshotState .SUCCESS ));
@@ -1097,6 +1095,7 @@ public void testCreateSnapshotV2WithIndexingLoad() throws Exception {
1097
1095
CreateSnapshotResponse createSnapshotResponse2 = client ().admin ()
1098
1096
.cluster ()
1099
1097
.prepareCreateSnapshot (snapshotRepoName , snapshotName1 )
1098
+ .setWaitForCompletion (true )
1100
1099
.get ();
1101
1100
1102
1101
SnapshotInfo snapshotInfo = createSnapshotResponse2 .getSnapshotInfo ();
@@ -1203,6 +1202,7 @@ public void testClusterManagerFailoverDuringSnapshotCreation() throws Exception
1203
1202
CreateSnapshotResponse createSnapshotResponse = client ().admin ()
1204
1203
.cluster ()
1205
1204
.prepareCreateSnapshot (snapshotRepoName , snapshotName1 )
1205
+ .setWaitForCompletion (true )
1206
1206
.get ();
1207
1207
snapshotInfo [0 ] = createSnapshotResponse .getSnapshotInfo ();
1208
1208
0 commit comments