Skip to content

Commit b075aa1

Browse files
Fixing ChunkingSettingsBuilder test for generating rerank chunking settings
1 parent 9467036 commit b075aa1

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
@@ -645,9 +645,6 @@ tests:
645645
- class: org.elasticsearch.upgrades.FullClusterRestartIT
646646
method: testSearch {cluster=UPGRADED}
647647
issue: https://github.com/elastic/elasticsearch/issues/135927
648-
- class: org.elasticsearch.xpack.inference.chunking.ChunkingSettingsBuilderTests
649-
method: testBuildChunkingSettingsForElasticReranker_QueryTokenCountLessThanHalfOfTokenLimit
650-
issue: https://github.com/elastic/elasticsearch/issues/135928
651648
- class: org.elasticsearch.upgrades.FullClusterRestartIT
652649
method: testPeerRecoveryRetentionLeases {cluster=UPGRADED}
653650
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)