Skip to content

Commit

Permalink
[8.7] Fix desired balance spec (#93617) (#95474)
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
arteam and idegtiarenko authored Apr 21, 2023
1 parent b5ee786 commit 6c46121
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ setup:
version: " - 8.6.99"
reason: "Field added in in 8.7.0"

- do:
cluster.state: {}
- set: { nodes._arbitrary_key_ : node_id }
- set: { nodes.$node_id.name : node_name }

- do:
_internal.get_desired_balance: { }

Expand Down Expand Up @@ -101,8 +106,8 @@ setup:
- is_true: 'cluster_balance_stats.tiers.data_content.actual_disk_usage.average'
- is_true: 'cluster_balance_stats.tiers.data_content.actual_disk_usage.std_dev'
- is_true: 'cluster_balance_stats.nodes'
- is_true: 'cluster_balance_stats.nodes.test-cluster-0'
- gte: { 'cluster_balance_stats.nodes.test-cluster-0.shard_count' : 0 }
- gte: { 'cluster_balance_stats.nodes.test-cluster-0.forecast_write_load': 0.0 }
- gte: { 'cluster_balance_stats.nodes.test-cluster-0.forecast_disk_usage_bytes' : 0 }
- gte: { 'cluster_balance_stats.nodes.test-cluster-0.actual_disk_usage_bytes' : 0 }
- is_true: 'cluster_balance_stats.nodes.$node_name'
- gte: { 'cluster_balance_stats.nodes.$node_name.shard_count' : 0 }
- gte: { 'cluster_balance_stats.nodes.$node_name.forecast_write_load': 0.0 }
- gte: { 'cluster_balance_stats.nodes.$node_name.forecast_disk_usage_bytes' : 0 }
- gte: { 'cluster_balance_stats.nodes.$node_name.actual_disk_usage_bytes' : 0 }
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ setup:
version: " - 8.6.99"
reason: "Field added in in 8.7.0"

- do:
cluster.state: {}
- set: { nodes._arbitrary_key_ : node_id }
- set: { nodes.$node_id.name : node_name }

- do:
_internal.get_desired_balance: { }

Expand Down Expand Up @@ -56,11 +61,11 @@ setup:
- is_true: 'cluster_balance_stats.tiers.data_content.actual_disk_usage.average'
- is_true: 'cluster_balance_stats.tiers.data_content.actual_disk_usage.std_dev'
- is_true: 'cluster_balance_stats.nodes'
- is_true: 'cluster_balance_stats.nodes.test-cluster-0'
- gte: { 'cluster_balance_stats.nodes.test-cluster-0.shard_count' : 0 }
- gte: { 'cluster_balance_stats.nodes.test-cluster-0.forecast_write_load': 0.0 }
- gte: { 'cluster_balance_stats.nodes.test-cluster-0.forecast_disk_usage_bytes' : 0 }
- gte: { 'cluster_balance_stats.nodes.test-cluster-0.actual_disk_usage_bytes' : 0 }
- is_true: 'cluster_balance_stats.nodes.$node_name'
- gte: { 'cluster_balance_stats.nodes.$node_name.shard_count' : 0 }
- gte: { 'cluster_balance_stats.nodes.$node_name.forecast_write_load': 0.0 }
- gte: { 'cluster_balance_stats.nodes.$node_name.forecast_disk_usage_bytes' : 0 }
- gte: { 'cluster_balance_stats.nodes.$node_name.actual_disk_usage_bytes' : 0 }

---
"Test get desired balance for single shard":
Expand Down

0 comments on commit 6c46121

Please sign in to comment.