Get node ID from nodes info in REST tests (#40052)#40532
Merged
DaveCTurner merged 1 commit intoelastic:7.xfrom Mar 27, 2019
Merged
Get node ID from nodes info in REST tests (#40052)#40532DaveCTurner merged 1 commit intoelastic:7.xfrom
DaveCTurner merged 1 commit intoelastic:7.xfrom
Conversation
We discussed recently that the cluster state API should be considered "internal" and therefore our usual cast-iron stability guarantees do not hold for this API. However, there are a good number of REST tests that try to identify the master node. Today they call `GET /_cluster/state` API and extract the master node ID from the response. In fact many of these tests just want an arbitary node ID (or perhaps a data node ID) so an alternative is to call `GET _nodes` or `GET _nodes/data:true` and obtain a node ID from the keys of the `nodes` map in the response. This change adds the ability for YAML-based REST tests to extract an arbitrary key from a map so that they can obtain a node ID from the nodes info API instead of using the master node ID from the cluster state API. Relates elastic#40047.
Collaborator
|
Pinging @elastic/es-core-infra |
Member
Author
|
Backport of #40052 opened for a CI run because there were conflicts during back porting. No review required. |
Member
Author
|
@elasticmachine test this please |
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.
We discussed recently that the cluster state API should be considered
"internal" and therefore our usual cast-iron stability guarantees do not hold
for this API.
However, there are a good number of REST tests that try to identify the master
node. Today they call
GET /_cluster/stateAPI and extract the master node IDfrom the response. In fact many of these tests just want an arbitary node ID
(or perhaps a data node ID) so an alternative is to call
GET _nodesorGET _nodes/data:trueand obtain a node ID from the keys of thenodesmap in theresponse.
This change adds the ability for YAML-based REST tests to extract an arbitrary
key from a map so that they can obtain a node ID from the nodes info API
instead of using the master node ID from the cluster state API.
Relates #40047.