Project

General

Profile

Actions

Bug #19187

closed

Ruby 3.1.3 testsuite fails after timezone 2022g update is applied

Added by coolo (Stephan Kulow) almost 2 years ago. Updated almost 2 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux-gnu]
[ruby-core:111220]

Description

The timezone database changed incompatible to what ruby's testsuite expects.

See the announcement here: http://mm.icann.org/pipermail/tz-announce/2022-November/000076.html and note the little detail

Singapore's 1981-12-31 change was at 16:00 UTC (23:30 local time),
not 24:00 local time. (Thanks to Geoff Clare via Robert Elz.)

Problem is that test/ruby/test_time_tz.rb tests this very detail in 3 places - and breaks.

  1. Failure:
    TestTimeTZ#test_asia_singapore [/home/abuild/rpmbuild/BUILD/ruby-3.1.3/test/ruby/test_time_tz.rb:143]:
    TZ=Asia/Singapore Time.local(1981, 12, 31, 23, 59, 59).
    <"1981-12-31 23:59:59 +0730"> expected but was
    <"1982-01-01 00:29:59 +0800">.

  2. Failure:
    TestTimeTZ#test_gen_Asia_Singapore_22 [/home/abuild/rpmbuild/BUILD/ruby-3.1.3/test/ruby/test_time_tz.rb:382]:
    TZ=Asia/Singapore Time.utc(1981, 12, 31, 16, 29, 59).localtime.
    <"1981-12-31 23:59:59 +0730"> expected but was
    <"1982-01-01 00:29:59 +0800">.

  3. Failure:
    TestTimeTZ#test_gen_Asia_Singapore_45 [/home/abuild/rpmbuild/BUILD/ruby-3.1.3/test/ruby/test_time_tz.rb:400]:
    TZ=Asia/Singapore Time.local(1981, 12, 31, 23, 59, 59).
    <"1981-12-31 23:59:59 +0730"> expected but was
    <"1982-01-01 00:29:59 +0800">.

I can see no other option than not to test this detail - because relying on correct timezone data (either way) is barely possible.

Updated by nagachika (Tomoyuki Chikanaga) almost 2 years ago

  • Status changed from Open to Closed
  • Backport changed from 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN to 2.7: REQUIRED, 3.0: REQUIRED, 3.1: REQUIRED

The workaround was committed to master branch at 58cc3c9f387dcf8f820b43e043b540fa06248da3.

Updated by nobu (Nobuyoshi Nakada) almost 2 years ago

coolo (Stephan Kulow) wrote:

I can see no other option than not to test this detail - because relying on correct timezone data (either way) is barely possible.

I agree that we should not test tzdata itself.
https://github.com/nobu/ruby/tree/tzdata-nitpick

Updated by usa (Usaku NAKAMURA) almost 2 years ago

  • Backport changed from 2.7: REQUIRED, 3.0: REQUIRED, 3.1: REQUIRED to 2.7: DONE, 3.0: REQUIRED, 3.1: REQUIRED

ruby_2_7 36cadad6434bc31bc2d60697698cd5b930c097ce merged revision(s) 58cc3c9f.

Updated by usa (Usaku NAKAMURA) almost 2 years ago

  • Backport changed from 2.7: DONE, 3.0: REQUIRED, 3.1: REQUIRED to 2.7: DONE, 3.0: DONE, 3.1: REQUIRED

ruby_3_0 a0a99185577794b1915eba0dc5154f09cc95e81d merged revision(s) 58cc3c9f.

Updated by nagachika (Tomoyuki Chikanaga) almost 2 years ago

  • Backport changed from 2.7: DONE, 3.0: DONE, 3.1: REQUIRED to 2.7: DONE, 3.0: DONE, 3.1: DONE

ruby_3_1 a1124dc162810f86cb0bff58cde24064cfc561bc merged revision(s) 58cc3c9f387dcf8f820b43e043b540fa06248da3.

Updated by vo.x (Vit Ondruch) almost 2 years ago

nobu (Nobuyoshi Nakada) wrote in #note-2:

coolo (Stephan Kulow) wrote:

I can see no other option than not to test this detail - because relying on correct timezone data (either way) is barely possible.

I agree that we should not test tzdata itself.
https://github.com/nobu/ruby/tree/tzdata-nitpick

Was this proposal forgotten or is this going to land?

Updated by mame (Yusuke Endoh) almost 2 years ago

I disagree with simply erasing the tests depending on tzdata.

We need to test our logic to handle leap seconds, etc.
If we remove the dependency on tzdata, I think we need to mock tzdata and test our logic.

But we don't have to go that far. I think using tzdata is good enough.
Following changes in tzdata is a bit annoying, but I don't think it's happening so frequently.

Updated by duerst (Martin Dürst) almost 2 years ago

mame (Yusuke Endoh) wrote in #note-7:

I disagree with simply erasing the tests depending on tzdata.

Following changes in tzdata is a bit annoying, but I don't think it's happening so frequently.

I agree. In particular, this test was for 1981. Data about 1981 should only change very infrequently, essentially only when a mistake in tzdata is detected and fixed.

Updated by nobu (Nobuyoshi Nakada) almost 2 years ago

mame (Yusuke Endoh) wrote in #note-7:

We need to test our logic to handle leap seconds, etc.
If we remove the dependency on tzdata, I think we need to mock tzdata and test our logic.

I understand your concern, but the changes in GH-6990 should be unrelated to leap seconds.

Updated by vo.x (Vit Ondruch) almost 2 years ago

I have opened #19251 to discuss the followup.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0