Skip to content

Commit f1045ed

Browse files
Fixing ChunkingSettingsBuilder test for generating rerank chunking settings (#135965)
Co-authored-by: Elastic Machine <[email protected]>
1 parent 793b0ae commit f1045ed

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

muted-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -633,9 +633,6 @@ tests:
633633
- class: org.elasticsearch.upgrades.FullClusterRestartIT
634634
method: testSearch {cluster=UPGRADED}
635635
issue: https://github.com/elastic/elasticsearch/issues/135927
636-
- class: org.elasticsearch.xpack.inference.chunking.ChunkingSettingsBuilderTests
637-
method: testBuildChunkingSettingsForElasticReranker_QueryTokenCountLessThanHalfOfTokenLimit
638-
issue: https://github.com/elastic/elasticsearch/issues/135928
639636
- class: org.elasticsearch.upgrades.FullClusterRestartIT
640637
method: testPeerRecoveryRetentionLeases {cluster=UPGRADED}
641638
issue: https://github.com/elastic/elasticsearch/issues/135929

x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/chunking/ChunkingSettingsBuilderTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public void testValidChunkingSettingsMap() {
5454
public void testBuildChunkingSettingsForElasticReranker_QueryTokenCountLessThanHalfOfTokenLimit() {
5555
// Generate a word count for a non-empty query that takes up less than half the token limit
5656
int maxQueryTokenCount = (ELASTIC_RERANKER_TOKEN_LIMIT - ELASTIC_RERANKER_EXTRA_TOKEN_COUNT) / 2;
57-
int queryWordCount = randomIntBetween(1, (int) (maxQueryTokenCount * WORDS_PER_TOKEN));
57+
int queryWordCount = randomIntBetween(1, (int) (maxQueryTokenCount * WORDS_PER_TOKEN) - 1);
5858
var queryTokenCount = Math.ceil(queryWordCount / WORDS_PER_TOKEN);
5959
ChunkingSettings chunkingSettings = ChunkingSettingsBuilder.buildChunkingSettingsForElasticRerank(queryWordCount);
6060
assertTrue(chunkingSettings instanceof SentenceBoundaryChunkingSettings);

0 commit comments

Comments
 (0)