---
setup:
- skip:
    features:
    - "headers"
    - "allowed_warnings_regex"
---
Test cat thread_pool output:
- do:
    cat.thread_pool: {}
    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"
- match:
    $body: "/  #node_name     name     active     queue     rejected\n^  (\\S+   \
      \    \\s+ \\S+  \\s+ \\d+    \\s+ \\d+   \\s+ \\d+      \\n)+  $/\n"
- do:
    cat.thread_pool:
      v: true
    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"
- match:
    $body: "/^   node_name \\s+ name \\s+ active \\s+ queue \\s+ rejected \\n\n  \
      \  (\\S+       \\s+ \\S+  \\s+ \\d+    \\s+ \\d+   \\s+ \\d+      \\n)+  $/\n"
- do:
    cat.thread_pool:
      h: "pid,id,h,i,po"
    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"
- match:
    $body: "/  #pid       id          host       ip                          port\n\
      \   (\\d+  \\s+  \\S+    \\s+  \\S+   \\s+  [0-9a-f:.%]+  \\s+  (\\d+|-)  \\\
      n)+  $/\n"
- do:
    cat.thread_pool:
      thread_pool_patterns: "write,management,flush,generic,force_merge"
      h: "id,name,active"
      v: true
    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"
- match:
    $body: "/^  id \\s+ name        \\s+ active \\n\n   (\\S+\\s+ flush       \\s+\
      \ \\d+    \\n\n    \\S+\\s+ force_merge \\s+ \\d+    \\n\n    \\S+\\s+ generic\
      \     \\s+ \\d+    \\n\n    \\S+\\s+ management  \\s+ \\d+    \\n\n    \\S+\\\
      s+ write       \\s+ \\d+    \\n)+  $/\n"
- do:
    cat.thread_pool:
      thread_pool_patterns: "write"
      h: "id,name,type,active,size,queue,queue_size,rejected,largest,completed,min,max,keep_alive"
      v: true
    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"
- match:
    $body: "/^  id  \\s+ name  \\s+ type  \\s+ active \\s+ size \\s+ queue \\s+ queue_size\
      \ \\s+ rejected \\s+ largest \\s+ completed \\s+ max \\s+ keep_alive \\n\n \
      \  (\\S+ \\s+ write \\s+ fixed \\s+ \\d+    \\s+ \\d+  \\s+ \\d+   \\s+ (-1|\\\
      d+)   \\s+ \\d+      \\s+ \\d+     \\s+ \\d+       \\s+ \\d* \\s+ \\S*     \
      \   \\n)+  $/\n"
- do:
    cat.thread_pool:
      thread_pool_patterns: "fetch*"
      h: "id,name,type,active,pool_size,queue,queue_size,rejected,largest,completed,core,max,size,keep_alive"
      v: true
    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"
- match:
    $body: "/^  id  \\s+ name                \\s+ type    \\s+ active \\s+ pool_size\
      \ \\s+ queue \\s+ queue_size \\s+ rejected \\s+ largest \\s+ completed \\s+\
      \ core \\s+ max \\s+ size \\s+ keep_alive \\n\n   (\\S+ \\s+ fetch_shard_started\
      \ \\s+ scaling \\s+ \\d+    \\s+ \\d+       \\s+ \\d+   \\s+ (-1|\\d+)   \\\
      s+ \\d+      \\s+ \\d+     \\s+ \\d+       \\s+ \\d*  \\s+ \\d* \\s+ \\d*  \\\
      s+ \\S*        \\n\n    \\S+ \\s+ fetch_shard_store   \\s+ scaling \\s+ \\d+\
      \    \\s+ \\d+       \\s+ \\d+   \\s+ (-1|\\d+)   \\s+ \\d+      \\s+ \\d+ \
      \    \\s+ \\d+       \\s+ \\d*  \\s+ \\d* \\s+ \\d*  \\s+ \\S*        \\n)+\
      \  $/\n"
- do:
    cat.thread_pool:
      thread_pool_patterns: "write,search"
    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"
- match:
    $body: "/  #node_name     name       active     queue     rejected\n^  (\\S+ \
      \      \\s+ search  \\s+ \\d+    \\s+ \\d+   \\s+ \\d+      \\n\n    \\S+  \
      \     \\s+ write   \\s+ \\d+    \\s+ \\d+   \\s+ \\d+      \\n)+  $/\n"
