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

houston pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/solr.git


The following commit(s) were added to refs/heads/branch_9x by this push:
     new 69c29a35337 Use LogWatcher instead of ErrorLogMuter for RankFieldTest
69c29a35337 is described below

commit 69c29a353377600c5f6a4f72ce15f7c582fd78f1
Author: Houston Putman <[email protected]>
AuthorDate: Wed Jul 16 10:55:32 2025 -0700

    Use LogWatcher instead of ErrorLogMuter for RankFieldTest
    
    (cherry picked from commit d88ba42e2a03a888b30b47989ef990a019191b63)
---
 solr/core/src/test/org/apache/solr/schema/RankFieldTest.java | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/solr/core/src/test/org/apache/solr/schema/RankFieldTest.java 
b/solr/core/src/test/org/apache/solr/schema/RankFieldTest.java
index cb354f1e398..3a4f1e48b5e 100644
--- a/solr/core/src/test/org/apache/solr/schema/RankFieldTest.java
+++ b/solr/core/src/test/org/apache/solr/schema/RankFieldTest.java
@@ -23,7 +23,7 @@ import org.apache.lucene.index.LeafReader;
 import org.apache.lucene.util.BytesRef;
 import org.apache.solr.SolrTestCaseJ4;
 import org.apache.solr.common.params.ModifiableSolrParams;
-import org.apache.solr.util.ErrorLogMuter;
+import org.apache.solr.util.LogListener;
 import org.apache.solr.util.TestHarness;
 import org.junit.BeforeClass;
 import org.junit.Ignore;
@@ -59,29 +59,32 @@ public class RankFieldTest extends SolrTestCaseJ4 {
   }
 
   public void testBadFormat() {
-    try (ErrorLogMuter errors = ErrorLogMuter.substring("Expecting float")) {
+    try (LogListener errors = LogListener.error().substring("Expecting 
float")) {
       assertFailedU(adoc("id", "1", RANK_1, "foo"));
 
       assertFailedU(adoc("id", "1", RANK_1, "1.2.3"));
       assertEquals(2, errors.getCount());
+      errors.clearQueue();
     }
 
-    try (ErrorLogMuter errors = ErrorLogMuter.substring("must be finite")) {
+    try (LogListener errors = LogListener.error().substring("must be finite")) 
{
       assertFailedU(adoc("id", "1", RANK_1, 
Float.toString(Float.POSITIVE_INFINITY)));
 
       assertFailedU(adoc("id", "1", RANK_1, 
Float.toString(Float.NEGATIVE_INFINITY)));
 
       assertFailedU(adoc("id", "1", RANK_1, Float.toString(Float.NaN)));
       assertEquals(3, errors.getCount());
+      errors.clearQueue();
     }
 
-    try (ErrorLogMuter errors = ErrorLogMuter.substring("must be a positive")) 
{
+    try (LogListener errors = LogListener.error().substring("must be a 
positive")) {
       assertFailedU(adoc("id", "1", RANK_1, Float.toString(-0.0f)));
 
       assertFailedU(adoc("id", "1", RANK_1, Float.toString(-1f)));
 
       assertFailedU(adoc("id", "1", RANK_1, Float.toString(0.0f)));
       assertEquals(3, errors.getCount());
+      errors.clearQueue();
     }
   }
 

Reply via email to