Skip to content

Commit

Permalink
ESQL: Improve error message in test (elastic#114524)
Browse files Browse the repository at this point in the history
Improve an error message in the test for `profile`ing the ordinals-based
grouping operator. It's failed in the past with a rather cryptic error
message. This will either keep it passing fully or give us a better
error message when it does fail.

Closes elastic#114380
  • Loading branch information
nik9000 authored and davidkyle committed Oct 13, 2024
1 parent 404fa94 commit f241488
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
3 changes: 0 additions & 3 deletions muted-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -340,9 +340,6 @@ tests:
- class: org.elasticsearch.xpack.security.CoreWithSecurityClientYamlTestSuiteIT
method: test {yaml=cluster.stats/30_ccs_stats/cross-cluster search stats search}
issue: https://github.com/elastic/elasticsearch/issues/114371
- class: org.elasticsearch.xpack.esql.qa.single_node.RestEsqlIT
method: testProfileOrdinalsGroupingOperator {SYNC}
issue: https://github.com/elastic/elasticsearch/issues/114380
- class: org.elasticsearch.xpack.inference.services.cohere.CohereServiceTests
method: testInfer_StreamRequest
issue: https://github.com/elastic/elasticsearch/issues/114385
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.greaterThan;
import static org.hamcrest.Matchers.greaterThanOrEqualTo;
import static org.hamcrest.Matchers.hasItem;
import static org.hamcrest.Matchers.instanceOf;
import static org.hamcrest.Matchers.not;
import static org.hamcrest.Matchers.startsWith;
Expand Down Expand Up @@ -331,14 +332,13 @@ public void testProfile() throws IOException {
}

public void testProfileOrdinalsGroupingOperator() throws IOException {
assumeTrue("requires pragmas", Build.current().isSnapshot());
indexTimestampData(1);

RequestObjectBuilder builder = requestObjectBuilder().query(fromIndex() + " | STATS AVG(value) BY test.keyword");
builder.profile(true);
if (Build.current().isSnapshot()) {
// Lock to shard level partitioning, so we get consistent profile output
builder.pragmas(Settings.builder().put("data_partitioning", "shard").build());
}
// Lock to shard level partitioning, so we get consistent profile output
builder.pragmas(Settings.builder().put("data_partitioning", "shard").build());
Map<String, Object> result = runEsql(builder);

List<List<String>> signatures = new ArrayList<>();
Expand All @@ -356,7 +356,7 @@ public void testProfileOrdinalsGroupingOperator() throws IOException {
signatures.add(sig);
}

assertThat(signatures.get(0).get(2), equalTo("OrdinalsGroupingOperator[aggregators=[\"sum of longs\", \"count\"]]"));
assertThat(signatures, hasItem(hasItem("OrdinalsGroupingOperator[aggregators=[\"sum of longs\", \"count\"]]")));
}

public void testInlineStatsProfile() throws IOException {
Expand Down

0 comments on commit f241488

Please sign in to comment.