Skip to content

Commit 6c46121

Browse files
arteamidegtiarenko
andauthored
[8.7] Fix desired balance spec (#93617) (#95474)
Backports #93617 to 8.7 * Spec relied on a presence of a node with `test-cluster-0` name. This change reads the name from the cluster state instead. Co-authored-by: Ievgen Degtiarenko <[email protected]>
1 parent b5ee786 commit 6c46121

File tree

2 files changed

+20
-10
lines changed
  • qa/smoke-test-multinode/src/yamlRestTest/resources/rest-api-spec/test/smoke_test_multinode
  • rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/cluster.desired_balance

2 files changed

+20
-10
lines changed

qa/smoke-test-multinode/src/yamlRestTest/resources/rest-api-spec/test/smoke_test_multinode/30_desired_balance.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ setup:
7171
version: " - 8.6.99"
7272
reason: "Field added in in 8.7.0"
7373

74+
- do:
75+
cluster.state: {}
76+
- set: { nodes._arbitrary_key_ : node_id }
77+
- set: { nodes.$node_id.name : node_name }
78+
7479
- do:
7580
_internal.get_desired_balance: { }
7681

@@ -101,8 +106,8 @@ setup:
101106
- is_true: 'cluster_balance_stats.tiers.data_content.actual_disk_usage.average'
102107
- is_true: 'cluster_balance_stats.tiers.data_content.actual_disk_usage.std_dev'
103108
- is_true: 'cluster_balance_stats.nodes'
104-
- is_true: 'cluster_balance_stats.nodes.test-cluster-0'
105-
- gte: { 'cluster_balance_stats.nodes.test-cluster-0.shard_count' : 0 }
106-
- gte: { 'cluster_balance_stats.nodes.test-cluster-0.forecast_write_load': 0.0 }
107-
- gte: { 'cluster_balance_stats.nodes.test-cluster-0.forecast_disk_usage_bytes' : 0 }
108-
- gte: { 'cluster_balance_stats.nodes.test-cluster-0.actual_disk_usage_bytes' : 0 }
109+
- is_true: 'cluster_balance_stats.nodes.$node_name'
110+
- gte: { 'cluster_balance_stats.nodes.$node_name.shard_count' : 0 }
111+
- gte: { 'cluster_balance_stats.nodes.$node_name.forecast_write_load': 0.0 }
112+
- gte: { 'cluster_balance_stats.nodes.$node_name.forecast_disk_usage_bytes' : 0 }
113+
- gte: { 'cluster_balance_stats.nodes.$node_name.actual_disk_usage_bytes' : 0 }

rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/cluster.desired_balance/10_basic.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ setup:
2626
version: " - 8.6.99"
2727
reason: "Field added in in 8.7.0"
2828

29+
- do:
30+
cluster.state: {}
31+
- set: { nodes._arbitrary_key_ : node_id }
32+
- set: { nodes.$node_id.name : node_name }
33+
2934
- do:
3035
_internal.get_desired_balance: { }
3136

@@ -56,11 +61,11 @@ setup:
5661
- is_true: 'cluster_balance_stats.tiers.data_content.actual_disk_usage.average'
5762
- is_true: 'cluster_balance_stats.tiers.data_content.actual_disk_usage.std_dev'
5863
- is_true: 'cluster_balance_stats.nodes'
59-
- is_true: 'cluster_balance_stats.nodes.test-cluster-0'
60-
- gte: { 'cluster_balance_stats.nodes.test-cluster-0.shard_count' : 0 }
61-
- gte: { 'cluster_balance_stats.nodes.test-cluster-0.forecast_write_load': 0.0 }
62-
- gte: { 'cluster_balance_stats.nodes.test-cluster-0.forecast_disk_usage_bytes' : 0 }
63-
- gte: { 'cluster_balance_stats.nodes.test-cluster-0.actual_disk_usage_bytes' : 0 }
64+
- is_true: 'cluster_balance_stats.nodes.$node_name'
65+
- gte: { 'cluster_balance_stats.nodes.$node_name.shard_count' : 0 }
66+
- gte: { 'cluster_balance_stats.nodes.$node_name.forecast_write_load': 0.0 }
67+
- gte: { 'cluster_balance_stats.nodes.$node_name.forecast_disk_usage_bytes' : 0 }
68+
- gte: { 'cluster_balance_stats.nodes.$node_name.actual_disk_usage_bytes' : 0 }
6469

6570
---
6671
"Test get desired balance for single shard":

0 commit comments

Comments
 (0)