You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by be...@apache.org on 2023/08/02 18:11:03 UTC
[lucene] branch main updated: Fix randomly failing field info format tests (#12473)
This is an automated email from the ASF dual-hosted git repository.
benwtrent 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 229dc7481ef Fix randomly failing field info format tests (#12473)
229dc7481ef is described below
commit 229dc7481ef7c3ca4cdcff65c8c10ef34a18835a
Author: Benjamin Trent <be...@gmail.com>
AuthorDate: Wed Aug 2 14:10:57 2023 -0400
Fix randomly failing field info format tests (#12473)
---
.../java/org/apache/lucene/tests/index/BaseFieldInfoFormatTestCase.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lucene/test-framework/src/java/org/apache/lucene/tests/index/BaseFieldInfoFormatTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/tests/index/BaseFieldInfoFormatTestCase.java
index 7a054c290c3..b3bd9656171 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/tests/index/BaseFieldInfoFormatTestCase.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/tests/index/BaseFieldInfoFormatTestCase.java
@@ -354,7 +354,7 @@ public abstract class BaseFieldInfoFormatTestCase extends BaseIndexFileFormatTes
type.setDimensions(dimension, indexDimension, dimensionNumBytes);
}
- if (r.nextBoolean()) {
+ if (r.nextBoolean() && getVectorsMaxDimensions(fieldName) > 0) {
int dimension = 1 + r.nextInt(getVectorsMaxDimensions(fieldName));
VectorSimilarityFunction similarityFunction =
RandomPicks.randomFrom(r, VectorSimilarityFunction.values());