mirror of https://github.com/apache/lucene.git
Use a serial merge scheduler to avoid race conditions when checking for hasPendingMerges().
Closes #12763
This commit is contained in:
parent
4e2ce76b3e
commit
c081cfa0ba
|
@ -2372,7 +2372,10 @@ public class TestIndexWriter extends LuceneTestCase {
|
||||||
|
|
||||||
public void testHasUncommittedChanges() throws IOException {
|
public void testHasUncommittedChanges() throws IOException {
|
||||||
Directory dir = newDirectory();
|
Directory dir = newDirectory();
|
||||||
IndexWriter writer = new IndexWriter(dir, newIndexWriterConfig(new MockAnalyzer(random())));
|
IndexWriter writer = new IndexWriter(dir,
|
||||||
|
newIndexWriterConfig(new MockAnalyzer(random()))
|
||||||
|
// Use a serial merge scheduler to avoid race conditions when checking for hasPendingMerges()
|
||||||
|
.setMergeScheduler(new SerialMergeScheduler()));
|
||||||
assertTrue(
|
assertTrue(
|
||||||
writer.hasUncommittedChanges()); // this will be true because a commit will create an empty
|
writer.hasUncommittedChanges()); // this will be true because a commit will create an empty
|
||||||
// index
|
// index
|
||||||
|
|
Loading…
Reference in New Issue