Skip to content

Fix generative tests #129833

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions muted-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -574,9 +574,6 @@ tests:
- class: org.elasticsearch.search.query.RescoreKnnVectorQueryIT
method: testKnnRetriever
issue: https://github.com/elastic/elasticsearch/issues/129818
- class: org.elasticsearch.xpack.esql.qa.single_node.GenerativeIT
method: test
issue: https://github.com/elastic/elasticsearch/issues/129819
- class: org.elasticsearch.index.engine.ThreadPoolMergeExecutorServiceDiskSpaceTests
method: testAbortingOrRunningMergeTaskHoldsUpBudget
issue: https://github.com/elastic/elasticsearch/issues/129823
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ public static String agg(List<Column> previousOutput) {
};
}
// all types
name = randomName(previousOutput);
name = randomBoolean() ? randomStringField(previousOutput) : randomNumericOrDateField(previousOutput);
if (name == null) {
return "count(*)";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,15 @@ public ValidationResult validateOutput(
}

// the -1 is for the additional RENAME, that could drop one column
if (previousColumns.size() - 1 > columns.size()) {
return new ValidationResult(false, "Expecting at least [" + previousColumns.size() + "] columns, got [" + columns.size() + "]");
int prevCols = previousColumns.size() - 1;

if (previousColumns.stream().anyMatch(x -> x.name().equals("<all-fields-projected>"))) {
// known bug https://github.com/elastic/elasticsearch/issues/121741
prevCols--;
}

if (prevCols > columns.size()) {
return new ValidationResult(false, "Expecting at least [" + prevCols + "] columns, got [" + columns.size() + "]");
}
return VALIDATION_OK;
}
Expand Down