Skip to content

Commit 8ce4932

Browse files
authored
Fixing randomization issue for TextSimilarityRankRetrieverBuilderTests (#112594)
Closes #112531. Due to randomly generating a `TextSimilarityRankRetrieverBuilder`, it could be the case that `rankWindowSize` < 10 (which is the default `size` parameter) causing validation errors when parsing source and the following exception ``` org.elasticsearch.action.ActionRequestValidationException: Validation Failed: 1: [rank] requires [rank_window_size: 4] be greater than or equal to [size: 10] ``` In this PR we just increase the lower bound for the randomly created retriever to be 100 to ensure that it is always greater than `size`.
1 parent ea73815 commit 8ce4932

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/rank/textsimilarity/TextSimilarityRankRetrieverBuilderTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public static TextSimilarityRankRetrieverBuilder createRandomTextSimilarityRankR
6262
randomAlphaOfLength(10),
6363
randomAlphaOfLength(20),
6464
randomAlphaOfLength(50),
65-
randomIntBetween(1, 10000),
65+
randomIntBetween(100, 10000),
6666
randomBoolean() ? null : randomFloatBetween(-1.0f, 1.0f, true)
6767
);
6868
}

0 commit comments

Comments
 (0)