File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
lucene/core/src/test/org/apache/lucene/index Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -2372,7 +2372,10 @@ public void testCorruptFirstCommit() throws Exception {
23722372
23732373 public void testHasUncommittedChanges () throws IOException {
23742374 Directory dir = newDirectory ();
2375- IndexWriter writer = new IndexWriter (dir , newIndexWriterConfig (new MockAnalyzer (random ())));
2375+ IndexWriter writer = new IndexWriter (dir ,
2376+ newIndexWriterConfig (new MockAnalyzer (random ()))
2377+ // Use a serial merge scheduler to avoid race conditions when checking for hasPendingMerges()
2378+ .setMergeScheduler (new SerialMergeScheduler ()));
23762379 assertTrue (
23772380 writer .hasUncommittedChanges ()); // this will be true because a commit will create an empty
23782381 // index
You can’t perform that action at this time.
0 commit comments