mirror of https://github.com/apache/lucene.git
LUCENE-2118: fix separate failure in TestIndexWriter.testOptimizeMaxNumSegments2; cutover to IndexWriter.waitForMerges
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1034011 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
3701a49475
commit
c23af909ad
|
@ -235,7 +235,8 @@ public class TestIndexWriter extends LuceneTestCase {
|
|||
for(int i=0;i<19;i++)
|
||||
writer.addDocument(doc);
|
||||
|
||||
((ConcurrentMergeScheduler) writer.getConfig().getMergeScheduler()).sync();
|
||||
writer.commit();
|
||||
writer.waitForMerges();
|
||||
writer.commit();
|
||||
|
||||
SegmentInfos sis = new SegmentInfos();
|
||||
|
@ -245,9 +246,9 @@ public class TestIndexWriter extends LuceneTestCase {
|
|||
|
||||
writer.optimize(7);
|
||||
writer.commit();
|
||||
writer.waitForMerges();
|
||||
|
||||
sis = new SegmentInfos();
|
||||
((ConcurrentMergeScheduler) writer.getConfig().getMergeScheduler()).sync();
|
||||
sis.read(dir);
|
||||
final int optSegCount = sis.size();
|
||||
|
||||
|
|
|
@ -164,7 +164,7 @@ public class TestIndexWriterMergePolicy extends LuceneTestCase {
|
|||
addDoc(writer);
|
||||
}
|
||||
writer.commit();
|
||||
((ConcurrentMergeScheduler) writer.getConfig().getMergeScheduler()).sync();
|
||||
writer.waitForMerges();
|
||||
writer.commit();
|
||||
checkInvariants(writer);
|
||||
|
||||
|
@ -203,7 +203,7 @@ public class TestIndexWriterMergePolicy extends LuceneTestCase {
|
|||
addDoc(writer);
|
||||
}
|
||||
writer.commit();
|
||||
((ConcurrentMergeScheduler) writer.getConfig().getMergeScheduler()).sync();
|
||||
writer.waitForMerges();
|
||||
writer.commit();
|
||||
checkInvariants(writer);
|
||||
assertEquals(10, writer.maxDoc());
|
||||
|
|
Loading…
Reference in New Issue