-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change time zone used in tests to better test date/time/zone/JVM-related corner cases #10078
Comments
Yes... It makes it easy to detect bugs/error because the printed time is so different from the current time. I'm ok with either choice. For |
How about choosing one of the hard timezones randomly on test start? 😈 |
Maybe we could have couple test suites where each would leverage different TZ (different JVM fork)? It is a bit annoying infrastructure but that would cover all the corner cases. |
@kokosing with this approach, what would become possible to test, what isn't possible if we go with e.g. |
I meant that we could stay with |
Actually there are two time zone definitions used in tests:
I was initially thinking about the first one, but now I think we should change both and to some different zones. |
Also, the proposed zones have local time change at midnight only forward. Forward change is more important as it affects representability of date-time values in The bad news is that there is other interesting property:
There are 3 zones that have properties (1, 3, 4-, 5):
|
My apologies. I intended this to be well-prepared proposal before posting this issue, but it turned into thinking aloud... There simply isn't a time zone that is a perfect fit. |
Doing this change may help with testing in #7122. |
@dain, I singled out |
I wasn't involved with Presto when the decision was made. But one of the very important reasons here (that I remember @dain talking about) is that its offset is positive. Given Presto team works in a negative zone, we had bugs that only affect users in positive zones. And that went unnoticed. I don't care that much about whole-hour. Assuming basic competitiveness of the code, I can't think of a way non-whole-hour zone can break. |
@haozhun let's use a positive offset zone for default session zone in tests ( |
See prestodb#10078 for discussion.
i added checkboxes to the issue description |
I am updating #10128 to cover product tests too (switching them to |
I remember now. Kathmandu doesn't have DST. |
See prestodb#10078 for discussion.
See prestodb#10078 for discussion.
See prestodb#10078 for discussion.
See prestodb#10078 for discussion.
As explained in #10940 (comment), we cannot use a zone with "property 5" (forward offset change at 1970-01-01 00:00:00 local time) as product tests's zone.
I propose to use |
See prestodb#10078 for discussion.
All tests are run with
Asia/Kathmandu
time zone. I think it was chosen because:These are nice properties, but there are other nice properties a time zone could have:
Since it's not possible to change JVM default zone for just a single test, using
Asia/Kathmandu
makes it not possible to test functionalities around DST changes. For example, reading TIMESTAMP values using JDBCResultSet.getTimestamp()
cannot succeed when TIMESTAMP value to be returned never occurred in JVM time zone, was skipped (DST change forward).For these reasons, I'd like to change time zone used in tests to one having DST. Unfortunately there isn't a zone that has all 4 properties on regular basis. I wish we could create a new one, just for programs testing..
I think we should choose one of these:
Pacific/Chatham
(has properties: 1, 2, 3 and partially 4)Pacific/Apia
(has properties: 1, 1, 1, 1, 1, 1, 1, 2-, 3, 4)I am aware changing time zone will require changing expected values in tests, whenever TIMESTAMP is touched, due to #7122.
cc @losipiuk @martint @electrum @haozhun
America/Bahia_Banderas
TestingSession
) →Europe/Vilnius
The text was updated successfully, but these errors were encountered: