LUCENE-9189: TestIndexWriterDelete.testDeletesOnDiskFull can run for minutes

The issue is that MockDirectoryWrapper's disk full check is horribly
inefficient. On every writeByte/etc, it totally recomputes disk space
across all files. This means it calls listAll() on the underlying
Directory (which sorts all the underlying files), then sums up fileLength()
for each of those files.

This leads to many pathological cases in the disk full tests... but the
number of tests impacted by this is minimal, and the logic is scary.
This commit is contained in:
Robert Muir 2020-01-28 12:24:31 -05:00
parent 3bcc97c8eb
commit 4773574578
No known key found for this signature in database
GPG Key ID: 817AE1DD322D7ECA
1 changed files with 3 additions and 1 deletions

View File

@ -482,11 +482,13 @@ public class TestIndexWriterDelete extends LuceneTestCase {
return hitCount;
}
// TODO: can we fix MockDirectoryWrapper disk full checking to be more efficient (not recompute on every write)?
@Nightly
public void testDeletesOnDiskFull() throws IOException {
doTestOperationsOnDiskFull(false);
}
// TODO: can we tone this test down so it isn't crazy slow?
// TODO: can we fix MockDirectoryWrapper disk full checking to be more efficient (not recompute on every write)?
@Nightly
public void testUpdatesOnDiskFull() throws IOException {
doTestOperationsOnDiskFull(true);