diff --git a/server/src/test/java/org/elasticsearch/indices/IndicesServiceTests.java b/server/src/test/java/org/elasticsearch/indices/IndicesServiceTests.java index 6aa33b347ea..07207264262 100644 --- a/server/src/test/java/org/elasticsearch/indices/IndicesServiceTests.java +++ b/server/src/test/java/org/elasticsearch/indices/IndicesServiceTests.java @@ -330,8 +330,10 @@ public class IndicesServiceTests extends ESSingleNodeTestCase { fail(e.getMessage()); } }); - assertThat(indicesService.hasUncompletedPendingDeletes(), equalTo(hasBogus)); // "bogus" index has not been removed - assertFalse(shardPath.exists()); + assertBusy(() -> { + assertThat(indicesService.hasUncompletedPendingDeletes(), equalTo(hasBogus)); // "bogus" index has not been removed + assertFalse(shardPath.exists()); + }); } public void testVerifyIfIndexContentDeleted() throws Exception {