Skip to content

Comments

[Inference API] Fixing flaky test for auth integrationt tests#140321

Merged
jonathan-buttner merged 2 commits intoelastic:mainfrom
jonathan-buttner:ia-auth-flaky-test-v2
Jan 7, 2026
Merged

[Inference API] Fixing flaky test for auth integrationt tests#140321
jonathan-buttner merged 2 commits intoelastic:mainfrom
jonathan-buttner:ia-auth-flaky-test-v2

Conversation

@jonathan-buttner
Copy link
Contributor

This is a follow up to: #139978

The tests were muted for a different reason. The issue was that we're adding an empty response before each test is run. The problem with that is the node some times starts (and the authorization task that would call the mock web server and get the empty response) before the @Before method within AuthorizationTaskExecutorIT is executed. This means we'd enqueue an empty response after the authorization task has attempted to retrieve the empty response, then when the test runs we'd enqueue another response. The test would retrieve the empty response and cause a failure.

I tried making the mock webserver a member and have it initialized whenever the node was started but that was resulting in null pointers within some of the tests. I'm opting for enqueuing an empty response right before a node is started and then also clearing the response queue within each test prior to enqueuing the response we expect.

@jonathan-buttner jonathan-buttner added >test Issues or PRs that are addressing/adding tests auto-backport Automatically create backport pull requests when merged :SearchOrg/Inference Label for the Search Inference team Team:Search - Inference v9.3.0 v9.3.1 v9.4.0 labels Jan 7, 2026
@jonathan-buttner jonathan-buttner marked this pull request as ready for review January 7, 2026 22:12
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/search-inference-team (Team:Search - Inference)

@jonathan-buttner jonathan-buttner merged commit c2122b3 into elastic:main Jan 7, 2026
35 checks passed
@elasticsearchmachine
Copy link
Collaborator

💔 Backport failed

Status Branch Result
9.3 Commit could not be cherrypicked due to conflicts

You can use sqren/backport to manually backport by running backport --upstream elastic/elasticsearch --pr 140321

@jonathan-buttner
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
9.3

Questions ?

Please refer to the Backport tool documentation

jonathan-buttner added a commit to jonathan-buttner/elasticsearch that referenced this pull request Jan 8, 2026
…c#140321)

* Fixing flaky test for auth integrationt tests

* Resetting the response queues

(cherry picked from commit c2122b3)

# Conflicts:
#	muted-tests.yml
elasticsearchmachine pushed a commit that referenced this pull request Jan 8, 2026
… (#140361)

* Fixing flaky test for auth integrationt tests

* Resetting the response queues

(cherry picked from commit c2122b3)

# Conflicts:
#	muted-tests.yml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-backport Automatically create backport pull requests when merged backport pending :SearchOrg/Inference Label for the Search Inference team Team:Search - Inference >test Issues or PRs that are addressing/adding tests v9.3.0 v9.3.1 v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants