Skip to content

ESQL: Fix EsqlNodeSubclassTest failure from mutating #125503

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
merged 2 commits into from
Mar 24, 2025

Conversation

alex-spies
Copy link
Contributor

@alex-spies alex-spies commented Mar 24, 2025

We shouldn't mutate LogicalPlan.child().output() (or just LogicalPlan.output()); we did so in RENAME, but only in EsqlNodeSubclassTest, making them flaky.

The PR at #122250 seems to have created a flaky test failure in EsqlNodeSubclassTests. Local runs with -Dtests.iters=100 lead to about two dozen failures in over 70k tests run. This is not a high failure rate, but still requires addressing.

The single line added to the Analyzer by that PR causes an UnsupportedOperationException on attempting to mutate an immutable collection when running EsqlNodeSubclassTests. It turns out that this code path comes from Rename.output() which is only called in test scenarios. So a quick fix is to copy the child output into a mutable collection.

We shouldn't mutate LogicalPlan.child().output() (or just
LogicalPlan.output()); we did so in RENAME, but only in
EsqlNodeSubclassTest, making them flaky.
@alex-spies alex-spies added >test Issues or PRs that are addressing/adding tests auto-backport Automatically create backport pull requests when merged :Analytics/ES|QL AKA ESQL v8.19.0 v9.0.1 v9.1.0 labels Mar 24, 2025
@elasticsearchmachine elasticsearchmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Mar 24, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-analytical-engine (Team:Analytics)

@alex-spies
Copy link
Contributor Author

alex-spies commented Mar 24, 2025

Validating this locally via

 while ./gradlew :x-pack:plugin:esql:test --tests "org.elasticsearch.xpack.esql.tree.EsqlNodeSubclassTests" -Dtests.iters=100; do echo ok; done

which looks good.

Copy link
Contributor

@craigtaverner craigtaverner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@alex-spies alex-spies added the auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) label Mar 24, 2025
@elasticsearchmachine elasticsearchmachine merged commit 04d0a0a into elastic:main Mar 24, 2025
17 checks passed
@alex-spies alex-spies deleted the fix-output-mutation branch March 24, 2025 16:37
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
8.x
9.0

alex-spies added a commit to alex-spies/elasticsearch that referenced this pull request Mar 24, 2025
We shouldn't mutate LogicalPlan.child().output() (or just
LogicalPlan.output()); we did so in RENAME, but only in
EsqlNodeSubclassTest, making them flaky.

>The PR at elastic#122250 seems to
have created a flaky test failure in `EsqlNodeSubclassTests`. Local runs
with `-Dtests.iters=100` lead to about two dozen failures in over 70k
tests run. This is not a high failure rate, but still requires
addressing. > >The single line added to the Analyzer by that PR causes
an `UnsupportedOperationException` on attempting to mutate an immutable
collection when running `EsqlNodeSubclassTests`. It turns out that this
code path comes from `Rename.output()` which is only called in test
scenarios. So a quick fix is to copy the child output into a mutable
collection.
alex-spies added a commit to alex-spies/elasticsearch that referenced this pull request Mar 24, 2025
We shouldn't mutate LogicalPlan.child().output() (or just
LogicalPlan.output()); we did so in RENAME, but only in
EsqlNodeSubclassTest, making them flaky.

>The PR at elastic#122250 seems to
have created a flaky test failure in `EsqlNodeSubclassTests`. Local runs
with `-Dtests.iters=100` lead to about two dozen failures in over 70k
tests run. This is not a high failure rate, but still requires
addressing. > >The single line added to the Analyzer by that PR causes
an `UnsupportedOperationException` on attempting to mutate an immutable
collection when running `EsqlNodeSubclassTests`. It turns out that this
code path comes from `Rename.output()` which is only called in test
scenarios. So a quick fix is to copy the child output into a mutable
collection.
elasticsearchmachine pushed a commit that referenced this pull request Mar 24, 2025
We shouldn't mutate LogicalPlan.child().output() (or just
LogicalPlan.output()); we did so in RENAME, but only in
EsqlNodeSubclassTest, making them flaky.

>The PR at #122250 seems to
have created a flaky test failure in `EsqlNodeSubclassTests`. Local runs
with `-Dtests.iters=100` lead to about two dozen failures in over 70k
tests run. This is not a high failure rate, but still requires
addressing. > >The single line added to the Analyzer by that PR causes
an `UnsupportedOperationException` on attempting to mutate an immutable
collection when running `EsqlNodeSubclassTests`. It turns out that this
code path comes from `Rename.output()` which is only called in test
scenarios. So a quick fix is to copy the child output into a mutable
collection.
elasticsearchmachine pushed a commit that referenced this pull request Mar 24, 2025
We shouldn't mutate LogicalPlan.child().output() (or just
LogicalPlan.output()); we did so in RENAME, but only in
EsqlNodeSubclassTest, making them flaky.

>The PR at #122250 seems to
have created a flaky test failure in `EsqlNodeSubclassTests`. Local runs
with `-Dtests.iters=100` lead to about two dozen failures in over 70k
tests run. This is not a high failure rate, but still requires
addressing. > >The single line added to the Analyzer by that PR causes
an `UnsupportedOperationException` on attempting to mutate an immutable
collection when running `EsqlNodeSubclassTests`. It turns out that this
code path comes from `Rename.output()` which is only called in test
scenarios. So a quick fix is to copy the child output into a mutable
collection.
omricohenn pushed a commit to omricohenn/elasticsearch that referenced this pull request Mar 28, 2025
We shouldn't mutate LogicalPlan.child().output() (or just
LogicalPlan.output()); we did so in RENAME, but only in
EsqlNodeSubclassTest, making them flaky.

>The PR at elastic#122250 seems to
have created a flaky test failure in `EsqlNodeSubclassTests`. Local runs
with `-Dtests.iters=100` lead to about two dozen failures in over 70k
tests run. This is not a high failure rate, but still requires
addressing. > >The single line added to the Analyzer by that PR causes
an `UnsupportedOperationException` on attempting to mutate an immutable
collection when running `EsqlNodeSubclassTests`. It turns out that this
code path comes from `Rename.output()` which is only called in test
scenarios. So a quick fix is to copy the child output into a mutable
collection.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/ES|QL AKA ESQL auto-backport Automatically create backport pull requests when merged auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) >test Issues or PRs that are addressing/adding tests v8.19.0 v9.0.1 v9.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants