Skip to content

Commit

Permalink
Adding integ test for scroll API where sort by _doc is getting early …
Browse files Browse the repository at this point in the history
…termination

Signed-off-by: gashutos <gashutos@amazon.com>
  • Loading branch information
gashutos committed Jun 12, 2023
1 parent 8d8f924 commit 106f43a
Showing 1 changed file with 161 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
---
"Basic scroll on time series workload for reversed leaf sorter":
- do:
indices.create:
index: test_scroll_time_series
body:
mappings:
properties:
name:
type: keyword
'@timestamp':
type: date

- do:
bulk:
refresh: true
index: test_scroll_time_series
body:
- '{"index": {}}'
- '{"name": "1", "@timestamp": "2010-03-12T01:07:00"}'
- '{"index": {}}'
- '{"name": "2", "@timestamp": "2010-03-12T01:07:01"}'
- '{"index": {}}'
- '{"name": "3", "@timestamp": "2010-03-12T01:07:02"}'
- '{"index": {}}'
- '{"name": "4", "@timestamp": "2010-03-12T01:07:03"}'
- '{"index": {}}'
- '{"name": "5", "@timestamp": "2010-03-12T01:07:04"}'
- '{"index": {}}'
- '{"name": "6", "@timestamp": "2010-03-12T01:07:05"}'
- '{"index": {}}'
- '{"name": "7", "@timestamp": "2010-03-12T01:07:06"}'
- '{"index": {}}'
- '{"name": "8", "@timestamp": "2010-03-12T01:07:07"}'
- '{"index": {}}'
- '{"name": "9", "@timestamp": "2010-03-12T01:07:08"}'
- '{"index": {}}'
- '{"name": "10", "@timestamp": "2010-03-12T01:07:09"}'
- do:
indices.refresh: {}
- do:
bulk:
refresh: true
index: test_scroll_time_series
body:
- '{"index": {}}'
- '{"name": "11", "@timestamp": "2010-03-12T01:07:10"}'
- '{"index": {}}'
- '{"name": "12", "@timestamp": "2010-03-12T01:07:11"}'
- '{"index": {}}'
- '{"name": "13", "@timestamp": "2010-03-12T01:07:12"}'
- '{"index": {}}'
- '{"name": "14", "@timestamp": "2010-03-12T01:07:13"}'
- '{"index": {}}'
- '{"name": "15", "@timestamp": "2010-03-12T01:07:14"}'
- '{"index": {}}'
- '{"name": "16", "@timestamp": "2010-03-12T01:07:15"}'
- '{"index": {}}'
- '{"name": "17", "@timestamp": "2010-03-12T01:07:16"}'
- '{"index": {}}'
- '{"name": "18", "@timestamp": "2010-03-12T01:07:17"}'
- '{"index": {}}'
- '{"name": "19", "@timestamp": "2010-03-12T01:07:18"}'
- '{"index": {}}'
- '{"name": "20", "@timestamp": "2010-03-12T01:07:19"}'
- do:
indices.refresh: { }
- do:
bulk:
refresh: true
index: test_scroll_time_series
body:
- '{"index": {}}'
- '{"name": "21", "@timestamp": "2010-03-12T01:07:20"}'
- '{"index": {}}'
- '{"name": "22", "@timestamp": "2010-03-12T01:07:21"}'
- '{"index": {}}'
- '{"name": "23", "@timestamp": "2010-03-12T01:07:22"}'
- '{"index": {}}'
- '{"name": "24", "@timestamp": "2010-03-12T01:07:23"}'
- '{"index": {}}'
- '{"name": "25", "@timestamp": "2010-03-12T01:07:24"}'
- '{"index": {}}'
- '{"name": "26", "@timestamp": "2010-03-12T01:07:25"}'
- '{"index": {}}'
- '{"name": "27", "@timestamp": "2010-03-12T01:07:26"}'
- '{"index": {}}'
- '{"name": "28", "@timestamp": "2010-03-12T01:07:27"}'
- '{"index": {}}'
- '{"name": "29", "@timestamp": "2010-03-12T01:07:28"}'
- '{"index": {}}'
- '{"name": "30", "@timestamp": "2010-03-12T01:07:29"}'
- do:
indices.refresh: { }

- do:
search:
rest_total_hits_as_int: true
index: test_scroll_time_series
size: 5
scroll: 1m
sort: _doc
body:
query:
match_all: {}

- set: {_scroll_id: scroll_id}
- match: {hits.total: 30 }
- length: {hits.hits: 5 }

- do:
scroll:
rest_total_hits_as_int: true
body: { "scroll_id": "$scroll_id", "scroll": "1m"}

- match: {hits.total: 30 }
- length: {hits.hits: 5 }

- do:
scroll:
rest_total_hits_as_int: true
body: { "scroll_id": "$scroll_id", "scroll": "1m" }

- match: { hits.total: 30 }
- length: { hits.hits: 5 }

- do:
scroll:
rest_total_hits_as_int: true
body: { "scroll_id": "$scroll_id", "scroll": "1m" }

- match: { hits.total: 30 }
- length: { hits.hits: 5 }

- do:
scroll:
rest_total_hits_as_int: true
body: { "scroll_id": "$scroll_id", "scroll": "1m" }

- match: { hits.total: 30 }
- length: { hits.hits: 5 }

- do:
scroll:
rest_total_hits_as_int: true
body: { "scroll_id": "$scroll_id", "scroll": "1m" }

- match: { hits.total: 30 }
- length: { hits.hits: 5 }

- do:
scroll:
rest_total_hits_as_int: true
body: { "scroll_id": "$scroll_id", "scroll": "1m" }

- match: { hits.total: 30 }
- length: { hits.hits: 0 }

- do:
clear_scroll:
scroll_id: $scroll_id

0 comments on commit 106f43a

Please sign in to comment.