Skip to content

Commit

Permalink
Add more yaml rest tests for search backpressure settings (#16012) (#…
Browse files Browse the repository at this point in the history
…16022)

Signed-off-by: Gao Binlong <[email protected]>
(cherry picked from commit 4963792)
  • Loading branch information
gaobinlong authored Sep 20, 2024
1 parent 0870adb commit ecefe47
Show file tree
Hide file tree
Showing 2 changed files with 340 additions and 146 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,149 +69,3 @@
include_defaults: true

- match: {defaults.node.attr.testattr: "test"}

---
"Test set search backpressure mode":

- skip:
version: "- 2.3.99"
reason: "Search backpressure was added in 2.4"

- do:
cluster.put_settings:
body:
persistent:
search_backpressure.mode: "monitor_only"

- match: {persistent: {search_backpressure: {mode: "monitor_only"}}}

---
"Test set invalid search backpressure mode":

- skip:
version: "- 2.7.99"
reason: "Parsing and validation of SearchBackpressureMode does not exist in versions < 2.8"

- do:
catch: bad_request
cluster.put_settings:
body:
persistent:
search_backpressure.mode: "monitor-only"

- match: {error.root_cause.0.type: "illegal_argument_exception"}
- match: { error.root_cause.0.reason: "Invalid SearchBackpressureMode: monitor-only" }
- match: { status: 400 }


---
"Test setting search backpressure cancellation settings":
- skip:
version: "- 2.17.99"
reason: "Fixed in 2.18.0"

- do:
cluster.put_settings:
body:
transient:
search_backpressure.search_task.cancellation_burst: 11
- is_true: acknowledged

- do:
cluster.get_settings:
flat_settings: false
- match: {transient.search_backpressure.search_task.cancellation_burst: "11"}

- do:
cluster.put_settings:
body:
transient:
search_backpressure.search_task.cancellation_rate: 0.1
- is_true: acknowledged

- do:
cluster.get_settings:
flat_settings: false
- match: {transient.search_backpressure.search_task.cancellation_rate: "0.1"}

- do:
cluster.put_settings:
body:
transient:
search_backpressure.search_task.cancellation_ratio: 0.2
- is_true: acknowledged

- do:
cluster.get_settings:
flat_settings: false
- match: {transient.search_backpressure.search_task.cancellation_ratio: "0.2"}

- do:
cluster.put_settings:
body:
transient:
search_backpressure.search_shard_task.cancellation_burst: 12
- is_true: acknowledged

- do:
cluster.get_settings:
flat_settings: false
- match: {transient.search_backpressure.search_shard_task.cancellation_burst: "12"}

- do:
cluster.put_settings:
body:
transient:
search_backpressure.search_shard_task.cancellation_rate: 0.3
- is_true: acknowledged

- do:
cluster.get_settings:
flat_settings: false
- match: {transient.search_backpressure.search_shard_task.cancellation_rate: "0.3"}

- do:
cluster.put_settings:
body:
transient:
search_backpressure.search_shard_task.cancellation_ratio: 0.4
- is_true: acknowledged

- do:
cluster.get_settings:
flat_settings: false
- match: {transient.search_backpressure.search_shard_task.cancellation_ratio: "0.4"}

---
"Test setting invalid search backpressure cancellation_rate and cancellation_ratio":
- skip:
version: "- 2.17.99"
reason: "Fixed in 2.18.0"

- do:
catch: /search_backpressure.search_task.cancellation_rate must be > 0/
cluster.put_settings:
body:
transient:
search_backpressure.search_task.cancellation_rate: 0.0

- do:
catch: /search_backpressure.search_task.cancellation_ratio must be > 0/
cluster.put_settings:
body:
transient:
search_backpressure.search_task.cancellation_ratio: 0.0

- do:
catch: /search_backpressure.search_shard_task.cancellation_rate must be > 0/
cluster.put_settings:
body:
transient:
search_backpressure.search_shard_task.cancellation_rate: 0.0

- do:
catch: /search_backpressure.search_shard_task.cancellation_ratio must be > 0/
cluster.put_settings:
body:
transient:
search_backpressure.search_shard_task.cancellation_ratio: 0.0
Loading

0 comments on commit ecefe47

Please sign in to comment.