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 2025/01/16 18:02:25 UTC

(lucene) 01/02: Fix `TestFeatureField.testStoreTermVectors` failure. (#14146)

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

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

commit 79cd9c007be6f21cc884b9bec9edb3efd6c95098
Author: Adrien Grand <jp...@gmail.com>
AuthorDate: Thu Jan 16 18:53:09 2025 +0100

    Fix `TestFeatureField.testStoreTermVectors` failure. (#14146)
    
    The error message is a bit different depending on whether you append to
    an existing `IndexingChain.PerField` object or to a new one.
---
 .../core/src/test/org/apache/lucene/document/TestFeatureField.java   | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lucene/core/src/test/org/apache/lucene/document/TestFeatureField.java b/lucene/core/src/test/org/apache/lucene/document/TestFeatureField.java
index 33918c4d8dc..bd0696f66d1 100644
--- a/lucene/core/src/test/org/apache/lucene/document/TestFeatureField.java
+++ b/lucene/core/src/test/org/apache/lucene/document/TestFeatureField.java
@@ -16,6 +16,7 @@
  */
 package org.apache.lucene.document;
 
+import static org.hamcrest.Matchers.anyOf;
 import static org.hamcrest.Matchers.containsString;
 import static org.hamcrest.Matchers.equalTo;
 
@@ -480,7 +481,9 @@ public class TestFeatureField extends LuceneTestCase {
     FeatureField invalid = new FeatureField("features", "pagerank", 1, false);
     doc.add(invalid);
     var exc = expectThrows(Exception.class, () -> writer.addDocument(doc));
-    assertThat(exc.getMessage(), containsString("store term vector"));
+    assertThat(
+        exc.getMessage(),
+        anyOf(containsString("store term vector"), containsString("storeTermVector")));
 
     writer.forceMerge(1);
     DirectoryReader reader = writer.getReader();