Skip to content

Get node ID from nodes info in REST tests (#40052)#40532

Merged
DaveCTurner merged 1 commit intoelastic:7.xfrom
DaveCTurner:2019-03-27-backport-40052
Mar 27, 2019
Merged

Get node ID from nodes info in REST tests (#40052)#40532
DaveCTurner merged 1 commit intoelastic:7.xfrom
DaveCTurner:2019-03-27-backport-40052

Conversation

@DaveCTurner
Copy link
Copy Markdown
Member

@DaveCTurner DaveCTurner commented Mar 27, 2019

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 #40047.

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.
@DaveCTurner DaveCTurner added :Core/Infra/REST API REST infrastructure and utilities backport labels Mar 27, 2019
@elasticmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-core-infra

@DaveCTurner
Copy link
Copy Markdown
Member Author

Backport of #40052 opened for a CI run because there were conflicts during back porting. No review required.

@DaveCTurner
Copy link
Copy Markdown
Member Author

@elasticmachine test this please

@DaveCTurner DaveCTurner merged commit 5a2ba34 into elastic:7.x Mar 27, 2019
@DaveCTurner DaveCTurner deleted the 2019-03-27-backport-40052 branch March 27, 2019 23:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport :Core/Infra/REST API REST infrastructure and utilities

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants