@@ -9,6 +9,9 @@ teardown:
99 _internal.delete_desired_nodes : {}
1010---
1111" Test update desired nodes " :
12+ - skip :
13+ reason : " contains is a newly added assertion"
14+ features : contains
1215 - do :
1316 cluster.state : {}
1417
@@ -49,15 +52,17 @@ teardown:
4952
5053 - do :
5154 _internal.get_desired_nodes : {}
52- - match :
53- $body :
54- history_id : " test"
55- version : 2
56- nodes :
57- - { settings: { node: { name: "instance-000187" } }, processors: 8, memory: "64gb", storage: "128gb", node_version: $es_version }
58- - { settings: { node: { name: "instance-000188" } }, processors: 16, memory: "128gb", storage: "1tb", node_version: $es_version }
55+
56+ - match : { history_id: "test" }
57+ - match : { version: 2 }
58+ - length : { nodes: 2 }
59+ - contains : { nodes: { settings: { node: { name: "instance-000187" } }, processors: 8, memory: "64gb", storage: "128gb", node_version: $es_version } }
60+ - contains : { nodes: { settings: { node: { name: "instance-000188" } }, processors: 16, memory: "128gb", storage: "1tb", node_version: $es_version } }
5961---
6062" Test update move to a new history id " :
63+ - skip :
64+ reason : " contains is a newly added assertion"
65+ features : contains
6166 - do :
6267 cluster.state : {}
6368
@@ -97,13 +102,11 @@ teardown:
97102
98103 - do :
99104 _internal.get_desired_nodes : {}
100- - match :
101- $body :
102- history_id : " new_history"
103- version : 1
104- nodes :
105- - { settings: { node: { external_id: "instance-000187" } }, processors: 8, memory: "64gb", storage: "128gb", node_version: $es_version }
106- - { settings: { node: { external_id: "instance-000188" } }, processors: 16, memory: "128gb", storage: "1tb", node_version: $es_version }
105+ - match : { history_id: "new_history" }
106+ - match : { version: 1 }
107+ - length : { nodes: 2 }
108+ - contains : { nodes: { settings: { node: { external_id: "instance-000187" } }, processors: 8, memory: "64gb", storage: "128gb", node_version: $es_version } }
109+ - contains : { nodes: { settings: { node: { external_id: "instance-000188" } }, processors: 16, memory: "128gb", storage: "1tb", node_version: $es_version } }
107110---
108111" Test delete desired nodes " :
109112 - do :
@@ -142,6 +145,9 @@ teardown:
142145 - match : { status: 404 }
143146---
144147" Test update desired nodes is idempotent " :
148+ - skip :
149+ reason : " contains is a newly added assertion"
150+ features : contains
145151 - do :
146152 cluster.state : {}
147153
@@ -158,16 +164,51 @@ teardown:
158164 body :
159165 nodes :
160166 - { settings: { "node.external_id": "instance-000187" }, processors: 8, memory: "64gb", storage: "128gb", node_version: $es_version }
167+ - { settings: { "node.external_id": "instance-000188" }, processors: 8, memory: "64gb", storage: "128gb", node_version: $es_version }
161168 - match : { replaced_existing_history_id: false }
162169
163170 - do :
164171 _internal.get_desired_nodes : {}
165- - match :
166- $body :
172+
173+ - match : { history_id: "test" }
174+ - match : { version: 1 }
175+ - length : { nodes: 2 }
176+ - contains : { nodes: { settings: { node: { external_id: "instance-000187" } }, processors: 8, memory: "64gb", storage: "128gb", node_version: $es_version } }
177+ - contains : { nodes: { settings: { node: { external_id: "instance-000188" } }, processors: 8, memory: "64gb", storage: "128gb", node_version: $es_version } }
178+
179+ - do :
180+ _internal.update_desired_nodes :
167181 history_id : " test"
168182 version : 1
169- nodes :
170- - { settings: { node: { external_id: "instance-000187" } }, processors: 8, memory: "64gb", storage: "128gb", node_version: $es_version }
183+ body :
184+ nodes :
185+ - { settings: { "node.external_id": "instance-000187" }, processors: 8, memory: "64gb", storage: "128gb", node_version: $es_version }
186+ - { settings: { "node.external_id": "instance-000188" }, processors: 8, memory: "64gb", storage: "128gb", node_version: $es_version }
187+
188+ - match : { replaced_existing_history_id: false }
189+
190+ - do :
191+ _internal.get_desired_nodes : {}
192+
193+ - match : { history_id: "test" }
194+ - match : { version: 1 }
195+ - length : { nodes: 2 }
196+ - contains : { nodes: { settings: { node: { external_id: "instance-000187" } }, processors: 8, memory: "64gb", storage: "128gb", node_version: $es_version } }
197+ - contains : { nodes: { settings: { node: { external_id: "instance-000188" } }, processors: 8, memory: "64gb", storage: "128gb", node_version: $es_version } }
198+ ---
199+ " Test update desired nodes is idempotent with different order " :
200+ - skip :
201+ version : " - 8.2.99"
202+ features : contains
203+ reason : " Bug fixed in 8.3.0 and uses contains feature"
204+ - do :
205+ cluster.state : {}
206+
207+ - set : { master_node: master }
208+
209+ - do :
210+ nodes.info : {}
211+ - set : { nodes.$master.version: es_version }
171212
172213 - do :
173214 _internal.update_desired_nodes :
@@ -176,16 +217,37 @@ teardown:
176217 body :
177218 nodes :
178219 - { settings: { "node.external_id": "instance-000187" }, processors: 8, memory: "64gb", storage: "128gb", node_version: $es_version }
220+ - { settings: { "node.external_id": "instance-000188" }, processors: 8, memory: "64gb", storage: "128gb", node_version: $es_version }
179221 - match : { replaced_existing_history_id: false }
180222
181223 - do :
182224 _internal.get_desired_nodes : {}
183- - match :
184- $body :
225+
226+ - match : { history_id: "test" }
227+ - match : { version: 1 }
228+ - length : { nodes: 2 }
229+ - contains : { nodes: { settings: { node: { external_id: "instance-000187" } }, processors: 8, memory: "64gb", storage: "128gb", node_version: $es_version } }
230+ - contains : { nodes: { settings: { node: { external_id: "instance-000188" } }, processors: 8, memory: "64gb", storage: "128gb", node_version: $es_version } }
231+
232+ - do :
233+ _internal.update_desired_nodes :
185234 history_id : " test"
186235 version : 1
187- nodes :
188- - { settings: { node: { external_id: "instance-000187" } }, processors: 8, memory: "64gb", storage: "128gb", node_version: $es_version }
236+ body :
237+ nodes :
238+ - { settings: { "node.external_id": "instance-000188" }, processors: 8, memory: "64gb", storage: "128gb", node_version: $es_version }
239+ - { settings: { "node.external_id": "instance-000187" }, processors: 8, memory: "64gb", storage: "128gb", node_version: $es_version }
240+
241+ - match : { replaced_existing_history_id: false }
242+
243+ - do :
244+ _internal.get_desired_nodes : {}
245+
246+ - match : { history_id: "test" }
247+ - match : { version: 1 }
248+ - length : { nodes: 2 }
249+ - contains : { nodes: { settings: { node: { external_id: "instance-000187" } }, processors: 8, memory: "64gb", storage: "128gb", node_version: $es_version } }
250+ - contains : { nodes: { settings: { node: { external_id: "instance-000188" } }, processors: 8, memory: "64gb", storage: "128gb", node_version: $es_version } }
189251---
190252" Test going backwards within the same history is forbidden " :
191253 - do :
@@ -343,6 +405,9 @@ teardown:
343405 - match : { replaced_existing_history_id: false }
344406---
345407" Test external_id or node.name is required " :
408+ - skip :
409+ version : " - 8.2.99"
410+ reason : " Change error code in 8.3"
346411 - do :
347412 cluster.state : {}
348413
@@ -361,11 +426,13 @@ teardown:
361426 nodes :
362427 - { settings: { }, processors: 8, memory: "64gb", storage: "128gb", node_version: $es_version }
363428 - match : { status: 400 }
364- - match : { error.type: illegal_argument_exception }
365- - match : { error.reason: "Nodes with ids [<missing>] in positions [0] contain invalid settings" }
366- - match : { error.suppressed.0.reason: "[node.name] or [node.external_id] is missing or empty" }
429+ - match : { error.type: x_content_parse_exception }
430+ - match : { error.caused_by.caused_by.caused_by.reason: "[node.name] or [node.external_id] is missing or empty" }
367431---
368432" Test external_id must have content " :
433+ - skip :
434+ version : " - 8.2.99"
435+ reason : " Change error code in 8.3"
369436 - do :
370437 cluster.state : {}
371438
@@ -384,9 +451,8 @@ teardown:
384451 nodes :
385452 - { settings: { "node.external_id": " " }, processors: 8, memory: "64gb", storage: "128gb", node_version: $es_version }
386453 - match : { status: 400 }
387- - match : { error.type: illegal_argument_exception }
388- - match : { error.reason: "Nodes with ids [<missing>] in positions [0] contain invalid settings" }
389- - match : { error.suppressed.0.reason: "[node.name] or [node.external_id] is missing or empty" }
454+ - match : { error.type: x_content_parse_exception }
455+ - match : { error.caused_by.caused_by.caused_by.reason: "[node.name] or [node.external_id] is missing or empty" }
390456---
391457" Test duplicated external ids are not allowed " :
392458 - do :
0 commit comments