Fix SLMSnapshotBlockingIntegTests.testSnapshotInProgress (#49533) (#49542)

This test must check for state `SUCCESS` as well. `SUCESS` in
`SnapshotsInProgress` means "all data nodes finished snapshotting sucessfully but master must still finalize the snapshot in the repo".
`SUCESS` does not mean that the snapshot is actually fully finished in this object.

You can easily reporduce the scenario in #49303 that has an in-progress snapshot in `SUCCESS` state
by waiting 20s before running the busy assert loop on the snapshot status so that all steps but the blocked
finalization can finish.

Closes #49303
This commit is contained in:
Armin Braun 2019-11-25 13:31:45 +01:00 committed by GitHub
parent 2502ff39a0
commit af0f97d50a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -143,7 +143,8 @@ public class SLMSnapshotBlockingIntegTests extends ESIntegTestCase {
SnapshotLifecyclePolicyItem.SnapshotInProgress inProgress = item.getSnapshotInProgress(); SnapshotLifecyclePolicyItem.SnapshotInProgress inProgress = item.getSnapshotInProgress();
assertThat(inProgress.getSnapshotId().getName(), equalTo(snapshotName)); assertThat(inProgress.getSnapshotId().getName(), equalTo(snapshotName));
assertThat(inProgress.getStartTime(), greaterThan(0L)); assertThat(inProgress.getStartTime(), greaterThan(0L));
assertThat(inProgress.getState(), anyOf(equalTo(SnapshotsInProgress.State.INIT), equalTo(SnapshotsInProgress.State.STARTED))); assertThat(inProgress.getState(), anyOf(equalTo(SnapshotsInProgress.State.INIT), equalTo(SnapshotsInProgress.State.STARTED),
equalTo(SnapshotsInProgress.State.SUCCESS)));
assertNull(inProgress.getFailure()); assertNull(inProgress.getFailure());
}); });