forked from elastic/elasticsearch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Eschew leniency when parsing time zones (elastic#77267)
- Loading branch information
1 parent
cba91c5
commit 6f47fa3
Showing
3 changed files
with
140 additions
and
1 deletion.
There are no files selected for viewing
95 changes: 95 additions & 0 deletions
95
...rc/yamlRestTest/resources/rest-api-spec/test/search.aggregation/49_range_timezone_bug.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
setup: | ||
- do: | ||
indices.create: | ||
index: test | ||
body: | ||
settings: | ||
number_of_replicas: 0 | ||
mappings: | ||
properties: | ||
mydate: | ||
type: date | ||
format: "uuuu-MM-dd'T'HH:mm:ss.SSSSSSSSSZZZZZ" | ||
|
||
- do: | ||
cluster.health: | ||
wait_for_status: green | ||
|
||
- do: | ||
index: | ||
index: test | ||
id: 1 | ||
body: { "mydate": "2021-08-12T01:00:00.000000000+02:00" } | ||
|
||
- do: | ||
indices.refresh: {} | ||
|
||
--- | ||
"respect offsets in range bounds": | ||
- skip: | ||
version: " - 7.99.99" | ||
reason: "Fixed in 7.16 (backport pending)" | ||
- do: | ||
search: | ||
rest_total_hits_as_int: true | ||
body: { | ||
"query": { | ||
"match_all": {} | ||
}, | ||
"aggregations": { | ||
"myagg": { | ||
"date_range": { | ||
"field": "mydate", | ||
"ranges": [ | ||
{ | ||
"from": "2021-08-12T00:00:00.000000000+02:00", | ||
"to": "2021-08-12T02:00:00.000000000+02:00" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
- match: { hits.total: 1 } | ||
- length: { aggregations.myagg.buckets: 1 } | ||
- match: { aggregations.myagg.buckets.0.from_as_string: "2021-08-11T22:00:00.000000000Z" } | ||
- match: { aggregations.myagg.buckets.0.from: 1628719200000 } | ||
- match: { aggregations.myagg.buckets.0.to_as_string: "2021-08-12T00:00:00.000000000Z" } | ||
- match: { aggregations.myagg.buckets.0.to: 1628726400000 } | ||
- match: { aggregations.myagg.buckets.0.doc_count: 1 } | ||
|
||
--- | ||
"offsets and timezones play nicely together": | ||
- skip: | ||
version: " - 7.99.99" | ||
reason: "Fixed in 7.16 (backport pending)" | ||
- do: | ||
search: | ||
rest_total_hits_as_int: true | ||
body: { | ||
"query": { | ||
"match_all": {} | ||
}, | ||
"aggregations": { | ||
"myagg": { | ||
"date_range": { | ||
"time_zone": "America/New_York", | ||
"field": "mydate", | ||
"ranges": [ | ||
{ | ||
"from": "2021-08-12T00:00:00.000000000+02:00", | ||
"to": "2021-08-12T02:00:00.000000000+02:00" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
- match: { hits.total: 1 } | ||
- length: { aggregations.myagg.buckets: 1 } | ||
- match: { aggregations.myagg.buckets.0.from_as_string: "2021-08-11T18:00:00.000000000-04:00" } | ||
- match: { aggregations.myagg.buckets.0.from: 1628719200000 } | ||
- match: { aggregations.myagg.buckets.0.to_as_string: "2021-08-11T20:00:00.000000000-04:00" } | ||
- match: { aggregations.myagg.buckets.0.to: 1628726400000 } | ||
- match: { aggregations.myagg.buckets.0.doc_count: 1 } | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters