You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by jp...@apache.org on 2022/05/18 21:36:01 UTC

[lucene] branch main updated: LUCENE-10574: Fix test failure.

This is an automated email from the ASF dual-hosted git repository.

jpountz pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/lucene.git


The following commit(s) were added to refs/heads/main by this push:
     new 4240159b44c LUCENE-10574: Fix test failure.
4240159b44c is described below

commit 4240159b44c6b3549c8dacab69748e7aaee3bfa4
Author: Adrien Grand <jp...@gmail.com>
AuthorDate: Wed May 18 23:31:47 2022 +0200

    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.
---
 .../src/test/org/apache/lucene/index/TestIndexWriterOnDiskFull.java   | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterOnDiskFull.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterOnDiskFull.java
index 4001fb982ba..0847ff63fd1 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterOnDiskFull.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterOnDiskFull.java
@@ -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 {