@@ -845,18 +845,13 @@ public void testCreateSnapshotV2() throws Exception {
845
845
846
846
String snapshotName2 = "test-create-snapshot2" ;
847
847
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 ()
850
850
.cluster ()
851
851
.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 );
860
855
}
861
856
862
857
public void testMixedSnapshotCreationWithV2RepositorySetting () throws Exception {
@@ -932,6 +927,7 @@ public void testMixedSnapshotCreationWithV2RepositorySetting() throws Exception
932
927
CreateSnapshotResponse createSnapshotResponse2 = client ().admin ()
933
928
.cluster ()
934
929
.prepareCreateSnapshot (snapshotRepoName , snapshotName2 )
930
+ .setWaitForCompletion (true )
935
931
.get ();
936
932
snapshotInfo = createSnapshotResponse2 .getSnapshotInfo ();
937
933
assertThat (snapshotInfo .state (), equalTo (SnapshotState .SUCCESS ));
@@ -993,6 +989,7 @@ public void testConcurrentSnapshotV2CreateOperation() throws InterruptedExceptio
993
989
CreateSnapshotResponse createSnapshotResponse2 = client ().admin ()
994
990
.cluster ()
995
991
.prepareCreateSnapshot (snapshotRepoName , snapshotName )
992
+ .setWaitForCompletion (true )
996
993
.get ();
997
994
SnapshotInfo snapshotInfo = createSnapshotResponse2 .getSnapshotInfo ();
998
995
assertThat (snapshotInfo .state (), equalTo (SnapshotState .SUCCESS ));
@@ -1068,6 +1065,7 @@ public void testCreateSnapshotV2WithRedIndex() throws Exception {
1068
1065
CreateSnapshotResponse createSnapshotResponse2 = client ().admin ()
1069
1066
.cluster ()
1070
1067
.prepareCreateSnapshot (snapshotRepoName , snapshotName1 )
1068
+ .setWaitForCompletion (true )
1071
1069
.get ();
1072
1070
SnapshotInfo snapshotInfo = createSnapshotResponse2 .getSnapshotInfo ();
1073
1071
assertThat (snapshotInfo .state (), equalTo (SnapshotState .SUCCESS ));
@@ -1136,6 +1134,7 @@ public void testCreateSnapshotV2WithIndexingLoad() throws Exception {
1136
1134
CreateSnapshotResponse createSnapshotResponse2 = client ().admin ()
1137
1135
.cluster ()
1138
1136
.prepareCreateSnapshot (snapshotRepoName , snapshotName1 )
1137
+ .setWaitForCompletion (true )
1139
1138
.get ();
1140
1139
1141
1140
SnapshotInfo snapshotInfo = createSnapshotResponse2 .getSnapshotInfo ();
@@ -1256,6 +1255,7 @@ public void testClusterManagerFailoverDuringSnapshotCreation() throws Exception
1256
1255
CreateSnapshotResponse createSnapshotResponse = client ().admin ()
1257
1256
.cluster ()
1258
1257
.prepareCreateSnapshot (snapshotRepoName , snapshotName1 )
1258
+ .setWaitForCompletion (true )
1259
1259
.get ();
1260
1260
snapshotInfo [0 ] = createSnapshotResponse .getSnapshotInfo ();
1261
1261
0 commit comments