Fix testPendingTasks (#42922)

Fixes a race in the test which can be reliably reproduced by adding Thread.sleep(100) to the end of
IndicesService.processPendingDeletes

Closes #18747
This commit is contained in:
Yannick Welsch 2019-06-06 14:05:17 +02:00
parent 72735be673
commit 9f7be70f7a
1 changed files with 4 additions and 2 deletions

View File

@ -330,8 +330,10 @@ public class IndicesServiceTests extends ESSingleNodeTestCase {
fail(e.getMessage()); fail(e.getMessage());
} }
}); });
assertBusy(() -> {
assertThat(indicesService.hasUncompletedPendingDeletes(), equalTo(hasBogus)); // "bogus" index has not been removed assertThat(indicesService.hasUncompletedPendingDeletes(), equalTo(hasBogus)); // "bogus" index has not been removed
assertFalse(shardPath.exists()); assertFalse(shardPath.exists());
});
} }
public void testVerifyIfIndexContentDeleted() throws Exception { public void testVerifyIfIndexContentDeleted() throws Exception {