Skip to content

Commit

Permalink
Fix SnapshotStatusApisIT (elastic#46563)
Browse files Browse the repository at this point in the history
Obviously we have to run the status request again to busy wait for
the `STARTED` state, just busy waiting on an existing response
won't do anything.

Closes elastic#45917
  • Loading branch information
original-brownbear authored and turackangal committed Sep 14, 2019
1 parent ce24088 commit eb2abef
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ public void testStatusApiConsistency() {
assertEquals(snStatus.getStats().getTime(), snapshotInfo.endTime() - snapshotInfo.startTime());
}

@AwaitsFix(bugUrl = "https://gradle-enterprise.elastic.co/s/savzjd7eyqdf6/tests/kyv2y2z3r4v7m-fol5ler4lgsjg")
public void testStatusAPICallInProgressSnapshot() throws Exception {
Client client = client();

Expand All @@ -101,9 +100,9 @@ public void testStatusAPICallInProgressSnapshot() throws Exception {
logger.info("--> wait for data nodes to get blocked");
waitForBlockOnAnyDataNode("test-repo", TimeValue.timeValueMinutes(1));

final List<SnapshotStatus> snapshotStatus = client.admin().cluster().snapshotsStatus(
new SnapshotsStatusRequest("test-repo", new String[]{"test-snap"})).actionGet().getSnapshots();
assertBusy(() -> assertEquals(SnapshotsInProgress.State.STARTED, snapshotStatus.get(0).getState()), 1L, TimeUnit.MINUTES);
assertBusy(() -> assertEquals(SnapshotsInProgress.State.STARTED, client.admin().cluster().snapshotsStatus(
new SnapshotsStatusRequest("test-repo", new String[]{"test-snap"})).actionGet().getSnapshots().get(0).getState()), 1L,
TimeUnit.MINUTES);

logger.info("--> unblock all data nodes");
unblockAllDataNodes("test-repo");
Expand Down

0 comments on commit eb2abef

Please sign in to comment.