Fix AsyncSearchErrorTraceIT_ testAsyncSearchFailingQueryErrorTraceFalse#137078
Merged
drempapis merged 1 commit intoelastic:mainfrom Oct 24, 2025
Conversation
Collaborator
|
Pinging @elastic/es-search-foundations (Team:Search Foundations) |
benchaplin
approved these changes
Oct 24, 2025
Contributor
benchaplin
left a comment
There was a problem hiding this comment.
Ha, nice catch! Resolves #133010 as well?
Contributor
|
Hm, another note - I wrote these tests completely wrong! The assertions work in request handlers, meaning they should be set BEFORE the async search starts. I'll open a PR once you merge @drempapis... |
Contributor
Author
I’ve updated the test method |
Collaborator
💚 Backport successful
|
drempapis
added a commit
to drempapis/elasticsearch
that referenced
this pull request
Oct 24, 2025
elasticsearchmachine
pushed a commit
that referenced
this pull request
Oct 24, 2025
This was referenced Oct 24, 2025
fzowl
pushed a commit
to voyage-ai/elasticsearch
that referenced
this pull request
Nov 3, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The exception is thrown while attempting to acquire a shard lock. The key stack frames show that it occurs during the after-test checks (assertAfterTest), when ESIntegTestCase runs its “assert after test” cleanup. At that point, it’s trying to lock shard 0 of the .async-search index, but the shard is still in the starting state because the async task hasn’t fully finished. As a result, the lock attempt times out after 5 seconds.
The REST response returns is_running as a Boolean, but the code reads it as a String and evaluates true.equals("true"), which is always false. As a result, the wait/poll step is skipped, and the test executes the assertion immediately. This creates a race condition where the async search has not yet finished propagating results between the data and coordinating nodes, causing ErrorTraceHelper.assertStackTraceCleared(..) to occasionally run too early and fail.
Closes #136986 #136691