Skip to content

[TEST] Ensure-green inference system indices in AuthorizationTaskExecutorIT#143866

Merged
dimitris-athanasiou merged 1 commit intoelastic:mainfrom
dimitris-athanasiou:ensure-green-inference-indices-in-AuthorizationTaskExecutorIT
Mar 9, 2026
Merged

[TEST] Ensure-green inference system indices in AuthorizationTaskExecutorIT#143866
dimitris-athanasiou merged 1 commit intoelastic:mainfrom
dimitris-athanasiou:ensure-green-inference-indices-in-AuthorizationTaskExecutorIT

Conversation

@dimitris-athanasiou
Copy link
Copy Markdown
Contributor

There are failures in the tests in AuthorizationTaskExecutorIT. We get the all shards fail error some times when we try to get models with ModelRegistry.getAllModels. After looking into this, I believe the cause is that the inference system indices may not manage to initialize properly by the time the test runs.

This calls the ensureGreen() method before any of those tests run. This should fix this potential issue.

Closes #140802
Closes #140849
Closes #143845
Relates #137911
Relates #138012

…utorIT

There are failures in the tests in AuthorizationTaskExecutorIT. We get the
`all shards fail` error some times when we try to get models with
`ModelRegistry.getAllModels`. After looking into this, I believe the cause
is that the inference system indices may not manage to initialize properly
by the time the test runs.

This calls the `ensureGreen()` method before any of those tests run.
This should fix this potential issue.

Closes elastic#140802
Closes elastic#140849
Closes elastic#143845
Relates elastic#137911
Relates elastic#138012
@dimitris-athanasiou dimitris-athanasiou added >test Issues or PRs that are addressing/adding tests :SearchOrg/Inference Label for the Search Inference team v9.4.0 labels Mar 9, 2026
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 9, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: a61d5cd7-06d6-406d-9db1-c83e1950caa5

📥 Commits

Reviewing files that changed from the base of the PR and between 1e07b3a and d610c73.

📒 Files selected for processing (1)
  • x-pack/plugin/inference/src/internalClusterTest/java/org/elasticsearch/xpack/inference/integration/AuthorizationTaskExecutorIT.java

📝 Walkthrough

Walkthrough

This change modifies the AuthorizationTaskExecutorIT test class to add environment readiness checks during test component creation. The update calls ensureGreen on InferenceIndex.INDEX_PATTERN and InferenceSecretsIndex.INDEX_PATTERN to verify indices are ready before proceeding. Two new imports are added for InferenceIndex and InferenceSecretsIndex. No public API signatures are affected.

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed PR adds ensureGreen calls for inference indices before tests run, directly addressing the intermittent 'all shards failed' failures reported in issues #140802, #140849, #143845.
Out of Scope Changes check ✅ Passed All changes are scoped to test initialization in AuthorizationTaskExecutorIT, directly supporting the objective of stabilizing the failing tests.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • 🛠️ Update Documentation: Commit on current branch
  • 🛠️ Update Documentation: Create PR

Comment @coderabbitai help to get the list of available commands and usage tips.

@dimitris-athanasiou dimitris-athanasiou merged commit 725dd0f into elastic:main Mar 9, 2026
36 checks passed
@dimitris-athanasiou dimitris-athanasiou deleted the ensure-green-inference-indices-in-AuthorizationTaskExecutorIT branch March 9, 2026 15:55
@DonalEvans
Copy link
Copy Markdown
Contributor

@dimitris-athanasiou It looks like I just missed the boat on this, but should the muted tests be unmuted? Both #140802 and #143845 have muted tests associated with them.

@dimitris-athanasiou
Copy link
Copy Markdown
Contributor Author

dimitris-athanasiou commented Mar 9, 2026

ah, I'll follow up. thanks for catching this!

dimitris-athanasiou added a commit to dimitris-athanasiou/elasticsearch that referenced this pull request Mar 9, 2026
Unmutes AuthorizationTaskExecutorIT tests after the fix elastic#143866.

Even though that fix does not target elastic#138012 directly, there could
be an underlying connection. Thus, I am also unmuting that test too.
For the very least, it would be useful to see if the failure remains
the same.
dimitris-athanasiou added a commit that referenced this pull request Mar 12, 2026
…tion IT (#143885)

After #143866, this is a better attempt at fixing those tests.

ensureGreen calls the cluster _health API. With providing the index pattern, this returns green
when no matching index exists.

We actually want to ensure the inference indices are created. Calling the GET _inference API does that.

Closes #140849
michalborek pushed a commit to michalborek/elasticsearch that referenced this pull request Mar 23, 2026
…tion IT (elastic#143885)

After elastic#143866, this is a better attempt at fixing those tests.

ensureGreen calls the cluster _health API. With providing the index pattern, this returns green
when no matching index exists.

We actually want to ensure the inference indices are created. Calling the GET _inference API does that.

Closes elastic#140849
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:SearchOrg/Inference Label for the Search Inference team Team:Search - Inference >test Issues or PRs that are addressing/adding tests v9.4.0

Projects

None yet

4 participants