---
setup:
- skip:
    features:
    - "headers"
    - "allowed_warnings_regex"
---
cluster health request timeout on waiting for nodes:
- requires:
    capabilities:
    - method: "GET"
      path: "/_cluster/health"
      capabilities:
      - "unassigned_pri_shard_count"
    test_runner_features: "capabilities"
    reason: "Capability required to run test"
- do:
    catch: "request_timeout"
    cluster.health:
      wait_for_nodes: 10
      timeout: "1ms"
    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"
- is_true: "timed_out"
- gte:
    number_of_nodes: 1
- gte:
    number_of_data_nodes: 1
- match:
    active_primary_shards: 0
- match:
    active_shards: 0
- match:
    relocating_shards: 0
- match:
    initializing_shards: 0
- match:
    unassigned_shards: 0
- match:
    unassigned_primary_shards: 0
- gte:
    number_of_pending_tasks: 0
---
cluster health request timeout waiting for active shards:
- requires:
    capabilities:
    - method: "GET"
      path: "/_cluster/health"
      capabilities:
      - "unassigned_pri_shard_count"
    test_runner_features: "capabilities"
    reason: "Capability required to run test"
- do:
    catch: "request_timeout"
    cluster.health:
      timeout: "1ms"
      wait_for_active_shards: 5
    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"
- is_true: "timed_out"
- gte:
    number_of_nodes: 1
- gte:
    number_of_data_nodes: 1
- match:
    active_primary_shards: 0
- match:
    active_shards: 0
- match:
    relocating_shards: 0
- match:
    initializing_shards: 0
- match:
    unassigned_shards: 0
- match:
    unassigned_primary_shards: 0
- gte:
    number_of_pending_tasks: 0
