From 9bf8e1e0608a177fe0ec0e3d8b6930ae1dfd08bd Mon Sep 17 00:00:00 2001 From: Armin Braun Date: Thu, 17 Oct 2019 08:55:56 +0200 Subject: [PATCH] Fix SLMSnapshotBlockingIntegTest (#47941) (#47963) The after snapshot action is interfering with SLM deleting snapshots here it seems, causing concurrent delete exceptions. Since these tests are now test-scoped there is no reason to run snapshot deletes after each test so we can remove them to avoid this issue. Closes #47937 --- .../slm/SLMSnapshotBlockingIntegTests.java | 19 ------------------- 1 file changed, 19 deletions(-) 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 d3f40a8cb0f..82539cb1bcd 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 @@ -38,7 +38,6 @@ import org.elasticsearch.xpack.core.slm.action.ExecuteSnapshotRetentionAction; import org.elasticsearch.xpack.core.slm.action.GetSnapshotLifecycleAction; import org.elasticsearch.xpack.core.slm.action.PutSnapshotLifecycleAction; import org.elasticsearch.xpack.ilm.IndexLifecycle; -import org.junit.After; import org.junit.Before; import java.util.Arrays; @@ -74,23 +73,6 @@ public class SLMSnapshotBlockingIntegTests extends ESIntegTestCase { ensureGreen(); } - @After - public void resetSLMSettings() throws Exception { - // Cancel/delete all snapshots - assertBusy(() -> { - logger.info("--> wiping all snapshots after test"); - client().admin().cluster().prepareGetSnapshots(REPO).get().getSnapshots() - .forEach(snapshotInfo -> { - try { - client().admin().cluster().prepareDeleteSnapshot(REPO, snapshotInfo.snapshotId().getName()).get(); - } catch (Exception e) { - logger.warn("exception cleaning up snapshot " + snapshotInfo.snapshotId().getName(), e); - fail("exception cleanup up snapshot"); - } - }); - }); - } - @Override protected Collection> nodePlugins() { return Arrays.asList(MockRepository.Plugin.class, LocalStateCompositeXPackPlugin.class, IndexLifecycle.class); @@ -287,7 +269,6 @@ public class SLMSnapshotBlockingIntegTests extends ESIntegTestCase { } } - @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/47937") public void testBasicFailureRetention() throws Exception { testUnsuccessfulSnapshotRetention(false);