[ML] Fix PyTorchModelIT::testDeploymentStats #81161
Merged
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.
PyTorchModelIT::testDeploymentStats
has been failing in #80819 due to missing fields in the GET stats response. The problem is in the test as it has the wrong expectations about what is returned when a deployment isstarting
The only way a stats response can be constructed like this is if there are no task responses from the individual nodes and only the nodes for
started
models are included in the GET stats requesthttps://github.com/elastic/elasticsearch/blob/master/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportGetDeploymentStatsAction.java#L123
The task request will never be sent to a node hosting a single model in the
starting
state. This is by design as those responses are built on the co-ordinating node. The test passed most of the time because the response is valid if the model isstarted
on at least 1 node.As to why sometimes the 2nd GET stats call failed this is because the 2 ml nodes have different views of the trained model allocation, one node knows the model is started there but the other doesn't. GET stats is not a master node action but the responses will be eventually consistent.
Closes #80819