Skip to content

Commit

Permalink
Fix occasional failure in BaseKnnVectorsFormatTestCase#testIllegalDim…
Browse files Browse the repository at this point in the history
…ensionTooLarge

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 apache#12436
  • Loading branch information
mayya-sharipova committed Jul 28, 2023
1 parent b247afe commit 9b6ba96
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,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 9b6ba96

Please sign in to comment.