From af0f97d50ab6f128f1fbe89efab6d6be5296b6ce Mon Sep 17 00:00:00 2001 From: Armin Braun Date: Mon, 25 Nov 2019 13:31:45 +0100 Subject: [PATCH] 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 --- .../elasticsearch/xpack/slm/SLMSnapshotBlockingIntegTests.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/slm/SLMSnapshotBlockingIntegTests.java b/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/slm/SLMSnapshotBlockingIntegTests.java index f37a067d3a1..453aa2555c1 100644 --- a/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/slm/SLMSnapshotBlockingIntegTests.java +++ b/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/slm/SLMSnapshotBlockingIntegTests.java @@ -143,7 +143,8 @@ public class SLMSnapshotBlockingIntegTests extends ESIntegTestCase { SnapshotLifecyclePolicyItem.SnapshotInProgress inProgress = item.getSnapshotInProgress(); assertThat(inProgress.getSnapshotId().getName(), equalTo(snapshotName)); 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()); });