Skip to content

Commit 0dba163

Browse files
ES|QL: Fix generative tests (#129717)
1 parent eeca493 commit 0dba163

File tree

3 files changed

+4
-13
lines changed

3 files changed

+4
-13
lines changed

muted-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -562,9 +562,6 @@ tests:
562562
- class: org.elasticsearch.search.query.VectorIT
563563
method: testFilteredQueryStrategy
564564
issue: https://github.com/elastic/elasticsearch/issues/129517
565-
- class: org.elasticsearch.xpack.esql.qa.single_node.GenerativeIT
566-
method: test
567-
issue: https://github.com/elastic/elasticsearch/issues/129453
568565
- class: org.elasticsearch.test.apmintegration.TracesApmIT
569566
method: testApmIntegration
570567
issue: https://github.com/elastic/elasticsearch/issues/129651

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
import org.elasticsearch.xpack.esql.qa.rest.generative.command.pipe.DropGenerator;
1414
import org.elasticsearch.xpack.esql.qa.rest.generative.command.pipe.EnrichGenerator;
1515
import org.elasticsearch.xpack.esql.qa.rest.generative.command.pipe.EvalGenerator;
16-
import org.elasticsearch.xpack.esql.qa.rest.generative.command.pipe.ForkGenerator;
1716
import org.elasticsearch.xpack.esql.qa.rest.generative.command.pipe.GrokGenerator;
1817
import org.elasticsearch.xpack.esql.qa.rest.generative.command.pipe.KeepGenerator;
1918
import org.elasticsearch.xpack.esql.qa.rest.generative.command.pipe.LimitGenerator;
@@ -54,7 +53,8 @@ public record QueryExecuted(String query, int depth, List<Column> outputSchema,
5453
DropGenerator.INSTANCE,
5554
EnrichGenerator.INSTANCE,
5655
EvalGenerator.INSTANCE,
57-
ForkGenerator.INSTANCE,
56+
// Awaits fix: https://github.com/elastic/elasticsearch/issues/129715
57+
// ForkGenerator.INSTANCE,
5858
GrokGenerator.INSTANCE,
5959
KeepGenerator.INSTANCE,
6060
LimitGenerator.INSTANCE,

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

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,9 @@ public ValidationResult validateOutput(
4242
List<List<Object>> output
4343
) {
4444
int limit = (int) commandDescription.context().get(LIMIT);
45-
boolean defaultLimit = false;
46-
for (CommandDescription previousCommand : previousCommands) {
47-
if (previousCommand.commandName().equals(LIMIT)) {
48-
defaultLimit = true;
49-
}
50-
}
5145

52-
if (previousOutput.size() > limit && output.size() != limit || defaultLimit && previousOutput.size() < output.size()) {
53-
return new ValidationResult(false, "Expecting [" + limit + "] records, got [" + output.size() + "]");
46+
if (output.size() > limit) {
47+
return new ValidationResult(false, "Expecting at most [" + limit + "] records, got [" + output.size() + "]");
5448
}
5549
return CommandGenerator.expectSameColumns(previousColumns, columns);
5650
}

0 commit comments

Comments
 (0)