Skip to content

Commit 085ef5c

Browse files
Fix generative tests (#129833)
1 parent 809dab1 commit 085ef5c

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

muted-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -574,9 +574,6 @@ tests:
574574
- class: org.elasticsearch.search.query.RescoreKnnVectorQueryIT
575575
method: testKnnRetriever
576576
issue: https://github.com/elastic/elasticsearch/issues/129818
577-
- class: org.elasticsearch.xpack.esql.qa.single_node.GenerativeIT
578-
method: test
579-
issue: https://github.com/elastic/elasticsearch/issues/129819
580577
- class: org.elasticsearch.index.engine.ThreadPoolMergeExecutorServiceDiskSpaceTests
581578
method: testAbortingOrRunningMergeTaskHoldsUpBudget
582579
issue: https://github.com/elastic/elasticsearch/issues/129823

x-pack/plugin/esql/qa/server/src/main/java/org/elasticsearch/xpack/esql/qa/rest/generative/EsqlQueryGenerator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ public static String agg(List<Column> previousOutput) {
184184
};
185185
}
186186
// all types
187-
name = randomName(previousOutput);
187+
name = randomBoolean() ? randomStringField(previousOutput) : randomNumericOrDateField(previousOutput);
188188
if (name == null) {
189189
return "count(*)";
190190
}

x-pack/plugin/esql/qa/server/src/main/java/org/elasticsearch/xpack/esql/qa/rest/generative/command/pipe/LookupJoinGenerator.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,15 @@ public ValidationResult validateOutput(
5555
}
5656

5757
// the -1 is for the additional RENAME, that could drop one column
58-
if (previousColumns.size() - 1 > columns.size()) {
59-
return new ValidationResult(false, "Expecting at least [" + previousColumns.size() + "] columns, got [" + columns.size() + "]");
58+
int prevCols = previousColumns.size() - 1;
59+
60+
if (previousColumns.stream().anyMatch(x -> x.name().equals("<all-fields-projected>"))) {
61+
// known bug https://github.com/elastic/elasticsearch/issues/121741
62+
prevCols--;
63+
}
64+
65+
if (prevCols > columns.size()) {
66+
return new ValidationResult(false, "Expecting at least [" + prevCols + "] columns, got [" + columns.size() + "]");
6067
}
6168
return VALIDATION_OK;
6269
}

0 commit comments

Comments
 (0)