mirror of https://github.com/apache/lucene.git
LUCENE-10574: Fix test failure.
If a LogByteSizeMergePolicy is used, then it might decide to not merge the two one-document segments if their on-disk sizes are too different. Using a LogDocMergePolicy addresses the issue as both segments are always considered the same size.
This commit is contained in:
parent
268d29b845
commit
4240159b44
|
@ -539,6 +539,8 @@ public class TestIndexWriterOnDiskFull extends LuceneTestCase {
|
|||
MockDirectoryWrapper dir = newMockDirectory();
|
||||
// IndexWriter w = new IndexWriter(dir, newIndexWriterConfig(new
|
||||
// MockAnalyzer(random)).setReaderPooling(true));
|
||||
LogDocMergePolicy mp = new LogDocMergePolicy();
|
||||
mp.setMergeFactor(2);
|
||||
IndexWriter w =
|
||||
new IndexWriter(
|
||||
dir,
|
||||
|
@ -546,7 +548,7 @@ public class TestIndexWriterOnDiskFull extends LuceneTestCase {
|
|||
.setMergeScheduler(new SerialMergeScheduler())
|
||||
.setReaderPooling(true)
|
||||
.setMergePolicy(
|
||||
new FilterMergePolicy(newLogMergePolicy(2)) {
|
||||
new FilterMergePolicy(mp) {
|
||||
@Override
|
||||
public boolean keepFullyDeletedSegment(
|
||||
IOSupplier<CodecReader> readerIOSupplier) throws IOException {
|
||||
|
|
Loading…
Reference in New Issue