Skip Menu |
Report information
Id: 122702
Status: open
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: coke <will [at] coleda.com>
Cc:
AdminCc:

Severity: (no value)
Tag: (no value)
Platform: (no value)
Patch Status: (no value)
VM: (no value)



Subject: TZ related failures in S32-temporal/local.t
Date: Thu, 4 Sep 2014 13:29:53 -0400
To: rakudobug [...] perl.org
From: Will Coleda <will [...] coleda.com>
Download (untitled) / with headers
text/plain 581b
This test was historical run only if the system timezone was the same as the test; recent updates force a value for $*TZ, but this causes several test failures, with results like: not ok 25 - DateTime.local (from UTC, with leap second) # Failed test 'DateTime.local (from UTC, with leap second)' # at t/spec/S32-temporal/local.t line 1 # expected: '1998-12-31T18:59:60-0500' # got: '1998-12-31T19:59:60-0400' There are more tests that expect the -0500 than just the failing ones, so this file needs some review. For now, fudging the failing tests. -- Will "Coke" Coleda
Download (untitled) / with headers
text/plain 1.8k
On Thu Sep 04 10:30:12 2014, coke wrote: Show quoted text
> This test was historical run only if the system timezone was the same > as the test; recent updates force a value for $*TZ, but this causes > several test failures, with results like: > > not ok 25 - DateTime.local (from UTC, with leap second) > > # Failed test 'DateTime.local (from UTC, with leap second)' > # at t/spec/S32-temporal/local.t line 1 > # expected: '1998-12-31T18:59:60-0500' > # got: '1998-12-31T19:59:60-0400' > > There are more tests that expect the -0500 than just the failing ones, > so this file needs some review. > > For now, fudging the failing tests. >
Are those tests actually supposed to pass? They seem to depend on knowing when the various timezones enter/leave DST, and when DST dates were modified. For example: Show quoted text
> $dt = ds('1984-04-29T06:55:00Z').local; > is ~$dt, '1984-04-29T01:55:00-0500', 'DateTime.local (from UTC, just before DST begins)';
Show quoted text
> $dt = ds('1984-04-29T07:02:00Z').local; > is ~$dt, '1984-04-29T03:02:00-0400', 'DateTime.local (from UTC, just after DST begins)';
This expects that the implementation knows that DST started in America/New_York at 3:00 on April 29 1984, and that at 1:55 it was still in standard time, and that the date that .local produces will be adjusted accordingly, regardless of whether the system time is in DST or not when the test is run. As another example, Show quoted text
> DateTime.new("2014-02-28T06:00:00") > 2014-02-28T06:00:00Z
Show quoted text
> DateTime.new("2014-02-28T06:00:00").local > 2014-02-28T18:00:00+1200
If those tests are expected to pass that is wrong, as NZ was in DST (+1300) in February, even though I am running that in September and my timezone is not in DST and so is +1200, the result should be: Show quoted text
> DateTime.new("2014-02-28T06:00:00").local > 2014-02-28T19:00:00+1300
I am not sure that it is supposed to work like that.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org