Skip to content

Commit

Permalink
Fix occasional failure in BaseKnnVectorsFormatTestCase#testIllegalDim…
Browse files Browse the repository at this point in the history
…ensionTooLarge (#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
  • Loading branch information
mayya-sharipova authored Jul 28, 2023
1 parent 119635a commit 155b2ed
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,10 @@ public void testIllegalDimensionTooLarge() throws Exception {
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();
Expand Down

0 comments on commit 155b2ed

Please sign in to comment.