You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by dw...@apache.org on 2025/02/26 14:12:23 UTC

(lucene) branch branch_10x updated: Fix TestSysoutLimits occasionally failing. (#14296)

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

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


The following commit(s) were added to refs/heads/branch_10x by this push:
     new f490fd4b71a Fix TestSysoutLimits occasionally failing. (#14296)
f490fd4b71a is described below

commit f490fd4b71aeb91d292a3228fad396ab46449a7c
Author: Dawid Weiss <da...@carrotsearch.com>
AuthorDate: Wed Feb 26 15:10:06 2025 +0100

    Fix TestSysoutLimits occasionally failing. (#14296)
---
 .../apache/lucene/internal/vectorization/VectorizationProvider.java | 3 ++-
 .../src/test/org/apache/lucene/tests/util/TestSysoutsLimits.java    | 6 ++++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/lucene/core/src/java/org/apache/lucene/internal/vectorization/VectorizationProvider.java b/lucene/core/src/java/org/apache/lucene/internal/vectorization/VectorizationProvider.java
index c0ed905353b..706bba6ab20 100644
--- a/lucene/core/src/java/org/apache/lucene/internal/vectorization/VectorizationProvider.java
+++ b/lucene/core/src/java/org/apache/lucene/internal/vectorization/VectorizationProvider.java
@@ -216,7 +216,8 @@ public abstract class VectorizationProvider {
           "org.apache.lucene.codecs.hnsw.FlatVectorScorerUtil",
           "org.apache.lucene.util.VectorUtil",
           "org.apache.lucene.codecs.lucene101.Lucene101PostingsReader",
-          "org.apache.lucene.codecs.lucene101.PostingIndexInput");
+          "org.apache.lucene.codecs.lucene101.PostingIndexInput",
+          "org.apache.lucene.tests.util.TestSysoutsLimits");
 
   private static void ensureCaller() {
     final boolean validCaller =
diff --git a/lucene/test-framework/src/test/org/apache/lucene/tests/util/TestSysoutsLimits.java b/lucene/test-framework/src/test/org/apache/lucene/tests/util/TestSysoutsLimits.java
index 7d4e28a02d9..b2c0c0763a7 100644
--- a/lucene/test-framework/src/test/org/apache/lucene/tests/util/TestSysoutsLimits.java
+++ b/lucene/test-framework/src/test/org/apache/lucene/tests/util/TestSysoutsLimits.java
@@ -18,6 +18,7 @@ package org.apache.lucene.tests.util;
 
 import com.carrotsearch.randomizedtesting.RandomizedTest;
 import java.util.stream.Collectors;
+import org.apache.lucene.internal.vectorization.VectorizationProvider;
 import org.junit.Assert;
 import org.junit.BeforeClass;
 import org.junit.Test;
@@ -30,6 +31,11 @@ import org.junit.runner.Result;
 public class TestSysoutsLimits extends WithNestedTests {
   public TestSysoutsLimits() {
     super(false);
+
+    // vectorization provider may print a warning during initialization,
+    // and we count sysout/syserr bytes exactly so bootstrap any
+    // initializations early.
+    VectorizationProvider.getInstance();
   }
 
   public static class ParentNestedTest extends LuceneTestCase