Skip to content

Commit 4be59ed

Browse files
Fix SLMSnapshotBlockingIntegTest (#47941)
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
1 parent 485e949 commit 4be59ed

File tree

1 file changed

+0
-20
lines changed

1 file changed

+0
-20
lines changed

x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/slm/SLMSnapshotBlockingIntegTests.java

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
import org.elasticsearch.xpack.core.slm.action.GetSnapshotLifecycleAction;
3838
import org.elasticsearch.xpack.core.slm.action.PutSnapshotLifecycleAction;
3939
import org.elasticsearch.xpack.ilm.IndexLifecycle;
40-
import org.junit.After;
4140
import org.junit.Before;
4241

4342
import java.util.Arrays;
@@ -73,23 +72,6 @@ public void ensureClusterNodes() {
7372
ensureGreen();
7473
}
7574

76-
@After
77-
public void resetSLMSettings() throws Exception {
78-
// Cancel/delete all snapshots
79-
assertBusy(() -> {
80-
logger.info("--> wiping all snapshots after test");
81-
client().admin().cluster().prepareGetSnapshots(REPO).get().getSnapshots(REPO)
82-
.forEach(snapshotInfo -> {
83-
try {
84-
client().admin().cluster().prepareDeleteSnapshot(REPO, snapshotInfo.snapshotId().getName()).get();
85-
} catch (Exception e) {
86-
logger.warn("exception cleaning up snapshot " + snapshotInfo.snapshotId().getName(), e);
87-
fail("exception cleanup up snapshot");
88-
}
89-
});
90-
});
91-
}
92-
9375
@Override
9476
protected Collection<Class<? extends Plugin>> nodePlugins() {
9577
return Arrays.asList(MockRepository.Plugin.class, LocalStateCompositeXPackPlugin.class, IndexLifecycle.class);
@@ -253,10 +235,8 @@ public void testRetentionWhileSnapshotInProgress() throws Exception {
253235
}
254236
}
255237

256-
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/47937")
257238
public void testBasicFailureRetention() throws Exception {
258239
testUnsuccessfulSnapshotRetention(false);
259-
260240
}
261241

262242
public void testBasicPartialRetention() throws Exception {

0 commit comments

Comments
 (0)