Skip to content

Commit 69d93d1

Browse files
authored
Fix testDeleteActionDoesntDeleteSearchableSnapshot (#68376) (#68406)
(cherry picked from commit 4ce4a12) Signed-off-by: Andrei Dan <[email protected]>
1 parent 6aa7cc6 commit 69d93d1

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/ilm/TimeSeriesLifecycleActionsIT.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1455,7 +1455,16 @@ public void testDeleteActionDoesntDeleteSearchableSnapshot() throws Exception {
14551455
return false;
14561456
}
14571457
}, 30, TimeUnit.SECONDS));
1458-
assertBusy(() -> assertFalse(indexExists(restoredIndexName)));
1458+
1459+
// wait for **both** the restored and the original managed index to not exist anymore
1460+
// (making sure the ILM policy finished - asserting only on the restored index has the
1461+
// problem of a fast executing test code that will have the
1462+
// `assertFalse(indexExists(restoredIndexName))` assertion pass before the restored index
1463+
// ever existed)
1464+
assertBusy(() -> {
1465+
assertFalse(indexExists(index));
1466+
assertFalse(indexExists(restoredIndexName));
1467+
}, 90, TimeUnit.SECONDS);
14591468

14601469
assertTrue("the snapshot we generate in the cold phase should not be deleted by the delete phase", waitUntil(() -> {
14611470
try {

0 commit comments

Comments
 (0)