You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ro...@apache.org on 2026/04/09 11:17:16 UTC

(lucene) branch main updated: Add forceMerge to TestIndexOptions#testFrozenFieldTypeCacheRestabilizes (#15946)

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

romseygeek 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 7ca782c6deb Add forceMerge to TestIndexOptions#testFrozenFieldTypeCacheRestabilizes (#15946)
7ca782c6deb is described below

commit 7ca782c6debf9696fd0f897d064de2feaa6f4622
Author: Alan Woodward <ro...@apache.org>
AuthorDate: Thu Apr 9 12:17:11 2026 +0100

    Add forceMerge to TestIndexOptions#testFrozenFieldTypeCacheRestabilizes (#15946)
    
    The test assumes we have a single segment, but randomization can
    sometimes give us more than that.  Adding a forceMerge call ensures
    the segment geometry is what we expect it to be.
    
    Fixes #15943
---
 lucene/core/src/test/org/apache/lucene/index/TestIndexOptions.java | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexOptions.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexOptions.java
index 6f66a9a6d2c..5fed25d5523 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestIndexOptions.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexOptions.java
@@ -291,6 +291,7 @@ public class TestIndexOptions extends LuceneTestCase {
     for (int i = 20; i < 30; i++) {
       w.addDocument(Collections.singleton(new Field("foo", "val" + i, ftA)));
     }
+    w.forceMerge(1); // just in case we had a random flush
     try (LeafReader r = getOnlyLeafReader(DirectoryReader.open(w))) {
       assertEquals(30, r.maxDoc());
     }