[ML] Fix serverless security trained models stats assertion on MKI - #291031
Closed
steliosmavro wants to merge 1 commit into
Closed
steliosmavro wants to merge 1 commit into
steliosmavro wants to merge 1 commit into
Conversation
…rity test The hardcoded total was bumped to 3 in elastic#275476 because the new Security Labs auto-install deploys a local ELSER model in CI. On real serverless with EIS available the same flow picks Jina, so no extra local model appears and the count stays at 2. Assert against what ES reports instead so the test holds in both environments.
Contributor
💚 Build Succeeded
Metrics [docs]
|
steliosmavro
marked this pull request as ready for review
September 15, 2026 08:47
|
Pinging @elastic/ml-ui (:ml) |
steliosmavro
enabled auto-merge (squash)
September 15, 2026 09:20
sphilipse
requested changes
Sep 15, 2026
| await ml.trainedModels.assertStats(3); | ||
| // The set of built-in models varies per environment (e.g. EIS vs local ELSER), so | ||
| // compare against what ES reports rather than a hardcoded count. | ||
| const { trained_model_configs: models } = await ml.api.getTrainedModelsES(); |
Member
There was a problem hiding this comment.
I don't think this change makes sense. Now we're just checking whether the list accurately reflects the API, but that's such a trivial check it's hardly worth doing.
Moreover, the fundamental problem is that we're now spinning up an ML node when we shouldn't. That's the thing we should fix.
Contributor
Author
There was a problem hiding this comment.
Good point, can we skip the test until a fix lands to unblock the ci?
Contributor
Author
|
Closing this in favor of the real fix from Sander in elastic/kibana#291195 which blocks local ELSER deploys for EIS inference IDs on Serverless. |
auto-merge was automatically disabled
September 15, 2026 15:52
Pull request was closed
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.
Summary
The serverless security
Trained models listFTR suite has been failing on the post merge MKI pipeline since #275476 landed:That PR changed the assertion from
assertStats(2)toassertStats(3). The extra model comes from the new Security Labs auto install hook that runs when the Security app mounts. In Kibana PR CI there is no EIS, so the default inference ID falls back to.elser-2-elasticsearchand ES deploys a local ELSER model that shows up in the trained models list. On a real serverless project EIS is available, so the same flow picks Jina v5 which is hosted remotely. No local model appears and the count stays at 2.The hardcoded number therefore only matched one of the two environments. This change asserts against the count that ES itself reports so the test holds in both.
Why this comparison is safe: the ML list route does not filter by space, and its only other filter (
filterForEnabledFeatureModels) is a no op for security projects becausead,dfaandnlpare all enabled there. So the UI total and_ml/trained_modelsalways agree.Test plan
x-pack/solutions/security/test/serverless/functional/configs/config.tsFTR config