Skip to content

Commit 97601b1

Browse files
authored
Kderusso/sparse vector ci failure (#117930)
* Fix CI failure in SparseVectorQueryBuilderTests * Unmute test
1 parent 2244070 commit 97601b1

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

muted-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,6 @@ tests:
221221
issue: https://github.com/elastic/elasticsearch/issues/117815
222222
- class: org.elasticsearch.xpack.ml.integration.DatafeedJobsRestIT
223223
issue: https://github.com/elastic/elasticsearch/issues/111319
224-
- class: org.elasticsearch.xpack.core.ml.search.SparseVectorQueryBuilderTests
225-
method: testToQuery
226-
issue: https://github.com/elastic/elasticsearch/issues/117904
227224
- class: org.elasticsearch.packaging.test.ArchiveGenerateInitialCredentialsTests
228225
method: test20NoAutoGenerationWhenAutoConfigurationDisabled
229226
issue: https://github.com/elastic/elasticsearch/issues/117891

x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/search/SparseVectorQueryBuilderTests.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,12 @@ public void testToQuery() throws IOException {
232232

233233
private void testDoToQuery(SparseVectorQueryBuilder queryBuilder, SearchExecutionContext context) throws IOException {
234234
Query query = queryBuilder.doToQuery(context);
235+
236+
// test query builder can randomly have no vectors, which rewrites to a MatchNoneQuery - nothing more to do in this case.
237+
if (query instanceof MatchNoDocsQuery) {
238+
return;
239+
}
240+
235241
assertTrue(query instanceof SparseVectorQueryWrapper);
236242
var sparseQuery = (SparseVectorQueryWrapper) query;
237243
if (queryBuilder.shouldPruneTokens()) {

0 commit comments

Comments
 (0)