Add rest test for sliced scroll (#24630)

This commit is contained in:
Jim Ferenczi 2017-05-12 00:07:24 +02:00 committed by GitHub
parent 4d86679f5a
commit 7b7e15023a
1 changed files with 74 additions and 4 deletions

View File

@ -1,5 +1,5 @@
---
"Sliced scroll":
setup:
- do:
indices.create:
index: test_sliced_scroll
@ -8,31 +8,101 @@
index:
index: test_sliced_scroll
type: test
id: 42
id: 1
body: { foo: 1 }
- do:
index:
index: test_sliced_scroll
type: test
id: 2
body: { foo: 2 }
- do:
index:
index: test_sliced_scroll
type: test
id: 3
body: { foo: 3 }
- do:
index:
index: test_sliced_scroll
type: test
id: 4
body: { foo: 4 }
- do:
indices.refresh: {}
---
"Sliced scroll":
- skip:
version: " - 5.3.0"
reason: Prior version uses a random seed per node to compute the hash of the keys.
- do:
search:
index: test_sliced_scroll
size: 1
scroll: 1m
sort: foo
body:
slice:
id: 0
max: 3
max: 2
query:
match_all: {}
- set: {_scroll_id: scroll_id}
- match: {hits.total: 3 }
- length: {hits.hits: 3 }
- match: {hits.hits.0._id: "2" }
- match: {hits.hits.1._id: "3" }
- match: {hits.hits.2._id: "4" }
- do:
scroll:
scroll_id: $scroll_id
scroll: 1m
- match: {hits.total: 3 }
- length: {hits.hits: 0 }
- do:
clear_scroll:
scroll_id: $scroll_id
- do:
search:
index: test_sliced_scroll
scroll: 1m
sort: foo
body:
slice:
id: 1
max: 2
query:
match_all: {}
- set: {_scroll_id: scroll_id}
- match: {hits.total: 1 }
- length: {hits.hits: 1 }
- match: {hits.hits.0._id: "1" }
- do:
scroll:
scroll_id: $scroll_id
scroll: 1m
- match: {hits.total: 1 }
- length: {hits.hits: 0 }
- do:
clear_scroll:
scroll_id: $scroll_id
---
"Sliced scroll with invalid arguments":
- do:
catch: /query_phase_execution_exception.*The number of slices.*index.max_slices_per_scroll/
search: