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
Fix tests with Europe/Amsterdam pre-1970 time on tzdata version 2022b. #939
Conversation
The Time Zone Database (tzdata) changed the pre-1970 timestamps in some zones including Europe/Amsterdam on tzdata version 2022b or later. See <eggert/tz@35fa37f>. The tzdata RPM package maintainer on Fedora project suggested changing the Ruby test, because the change is intentional. See <https://bugzilla.redhat.com/show_bug.cgi?id=2118259#c1>. We use post-1970 time test data to simplify the test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Thanks for your checking. Please sync this commit to the ruby/ruby too. |
* Upgrade `step-cli` to 0.22.0 and `step-ca` to 0.22.1. * Fix tzdata tests that broke with 2022b, refs ruby/spec#939.
What did this test intend? Previously, the time seemed the edge case when the time zone rule changed, however the same day in 1970 seems not. |
I assume that this test just wants to test |
Thank you, I see. |
This was disabled by b7577b4, while properly fixed upstream by: ruby/spec#939
ruby/ruby#6393 merged |
@nobu Please use |
@eregon I din't know |
Still I'm curious why we should test a CET day, which isn't an edge-case. |
@junaruga @eregon I don't think this change makes sense. According to the original commit of the spec, the intention of the spec was to test the moment when the time zone was changed. According to this article, the timezone in Amsterdam was actually changed from NET to CEST on 16th May 1940. There are no timezone changes in Amsterdam since 1970 (except for daylight saving time). So using post-1970 does not make sense for this spec. Instead, how about just removing the spec if it is difficult to test the intention due to tzdata? |
Ah, I interpreted I think we should keep the example and just fix the description. |
What do you mean by “keep”? |
I see. Thanks for the catching up. Now on the tzdata >= 2022b, the timezone in Amsterdam is WEST on 16th May 1940.
I am ok with your idea. |
|
Does keeping it has any meaning? |
Yes, it seems the only test in that file for TZ=Europe/Amsterdam => the Time zone is "CET", i.e., how the TZ value is resolved to something different than just |
Why is Amsterdam special to test now? |
The Time Zone Database (tzdata) changed the pre-1970 timestamps in some zones
including Europe/Amsterdam on tzdata version 2022b or later.
See eggert/tz@35fa37f.
The tzdata RPM package maintainer on Fedora project suggested changing the Ruby
test, because the change is intentional.
See https://bugzilla.redhat.com/show_bug.cgi?id=2118259#c1.
We use post-1970 time test data to simplify the test.
This PR fixes #936. I tested the command in the 2 cases below.
tzdata: version 2022b, Ruby: the latest master branch
tzdata: version 2022a, Ruby: 3.1.1
Note for the return value of the
Time.send(:local, 1970, 5, 16).to_a
.https://ruby-doc.org/core-3.1.2/Time.html#method-i-to_a