Fix occasional failure in BaseKnnVectorsFormatTestCase#testIllegalDimensionTooLarge (#12467)

Depending whether a document with dimensions > maxDims created
on a new segment or already existing segment, we may get
different error messages. This fix adds another possible
error message we may get.

Relates to #12436
This commit is contained in:
Mayya Sharipova 2023-07-28 09:37:16 -04:00 committed by GitHub
parent 119635ad80
commit 155b2edbe3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -496,7 +496,10 @@ public abstract class BaseKnnVectorsFormatTestCase extends BaseIndexFileFormatTe
exc = expectThrows(IllegalArgumentException.class, () -> w.addDocument(doc3));
assertTrue(
exc.getMessage()
.contains("Inconsistency of field data structures across documents for field [f]"));
.contains("Inconsistency of field data structures across documents for field [f]")
|| exc.getMessage()
.contains(
"vector's dimensions must be <= [" + getVectorsMaxDimensions("f") + "]"));
w.flush();
Document doc4 = new Document();