ruby-changes:59851
From: Koichi <ko1@a...>
Date: Tue, 28 Jan 2020 18:22:00 +0900 (JST)
Subject: [ruby-changes:59851] dd64c34682 (master): support multi-run for test/ruby/test_time.rb
https://git.ruby-lang.org/ruby.git/commit/?id=dd64c34682 From dd64c34682bfcb976ec6fb0c6182fb09d9d790d3 Mon Sep 17 00:00:00 2001 From: Koichi Sasada <ko1@a...> Date: Tue, 28 Jan 2020 18:15:14 +0900 Subject: support multi-run for test/ruby/test_time.rb ruby/test_time_tz.rb (not sure only this file affects) changes TZ and it seems to change internal state. This internal state change fails test_2038 and test_timegm on 2nd time execution. At this time I have no idea how to fix this issue, so I skips these tests on 2nd trial. You can try this failure with the following command without this patch. $ make test-all TESTS='--repeat-count=2 ruby/require ruby/time ruby/time_tz' diff --git a/test/ruby/test_time.rb b/test/ruby/test_time.rb index 3cf7f2b..0ff09f3 100644 --- a/test/ruby/test_time.rb +++ b/test/ruby/test_time.rb @@ -108,6 +108,10 @@ class TestTime < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_time.rb#L108 assert_equal(78796800, Time.utc(1972, 7, 1, 0, 0, 0).tv_sec) assert_equal(78796801, Time.utc(1972, 7, 1, 0, 0, 1).tv_sec) assert_equal(946684800, Time.utc(2000, 1, 1, 0, 0, 0).tv_sec) + + # Giveup to try 2nd test because some state is changed. + skip if Minitest::Unit.current_repeat_count > 0 + assert_equal(0x7fffffff, Time.utc(2038, 1, 19, 3, 14, 7).tv_sec) assert_equal(0x80000000, Time.utc(2038, 1, 19, 3, 14, 8).tv_sec) else @@ -1133,6 +1137,9 @@ class TestTime < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_time.rb#L1137 end def test_2038 + # Giveup to try 2nd test because some state is changed. + skip if Minitest::Unit.current_repeat_count > 0 + if no_leap_seconds? assert_equal(0x80000000, Time.utc(2038, 1, 19, 3, 14, 8).tv_sec) end -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/