---
setup:
- skip:
    features:
    - "headers"
    - "allowed_warnings_regex"
---
cluster health test drilling down into a feature:
- requires:
    cluster_features: "gte_v8.7.0"
    reason: "the API path changed in 8.7"
- do:
    health_report:
      feature: "master_is_stable"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- is_true: "cluster_name"
- match:
    indicators.master_is_stable.status: "green"
- match:
    indicators.master_is_stable.symptom: "The cluster has a stable master node"
- is_true: "indicators.master_is_stable.details.current_master"
- is_true: "indicators.master_is_stable.details.recent_masters"
- do:
    health_report:
      feature: "master_is_stable"
      verbose: false
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- is_true: "cluster_name"
- match:
    indicators.master_is_stable.status: "green"
- match:
    indicators.master_is_stable.symptom: "The cluster has a stable master node"
- is_false: "indicators.master_is_stable.details"
