---
"can override wait_for_active_shards":
  - do:
      indices.create:
          index: test
          body:
            settings:
              number_of_replicas: 5
  - do:
      index:
        index:       test
        id:          "1"
        body:        {"text": "test"}
  - do:
      indices.refresh: {}

  - do:
      catch: unavailable
      update_by_query:
        index: test
        wait_for_active_shards: 4
        timeout: 1s
  - match:
      failures.0.cause.reason: /Not.enough.active.copies.to.meet.shard.count.of.\[4\].\(have.1,.needed.4\)..Timeout\:.\[1s\],.request:.+/

  - do:
      update_by_query:
        index: test
        wait_for_active_shards: 1
  - match: {failures: []}
  - match: {updated: 1}
  - match: {version_conflicts: 0}

  - do:
      get:
        index: test
        id:    "1"
