Fix test after #12549 take 2.

This commit is contained in:
Adrien Grand 2023-11-03 09:08:34 +01:00
parent 43a568cb33
commit 10ebd9025a
1 changed files with 6 additions and 5 deletions

View File

@ -2395,11 +2395,12 @@ public class TestIndexWriter extends LuceneTestCase {
writer.addDocument(doc);
assertTrue(writer.hasUncommittedChanges());
// Must commit, waitForMerges, commit again, to be
// certain that hasUncommittedChanges returns false:
writer.commit();
writer.waitForMerges();
writer.commit();
// Must commit and wait for merges as long as the commit triggers merges to be certain that
// hasUncommittedChanges returns false
do {
writer.waitForMerges();
writer.commit();
} while (writer.hasPendingMerges());
assertFalse(writer.hasUncommittedChanges());
writer.deleteDocuments(new Term("id", "xyz"));
assertTrue(writer.hasUncommittedChanges());