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
DateTime creation in local time zone uses UTC instead if getting the local time zone offset causes an error #15560
Comments
Added Area-Library label. |
Removed Library-Core, Area-Library labels. |
Removed Library-Intl label. |
After adding a lot of logging for this I saw the problem in a log on Friday. The log is very long, as there's lots of debug code around that now, but the relevant portion seems to be which comes from date_format_helpers.dart lines 42-78. So we're calling new DateTime and in one case it's producing the desired date and in the other it's applying UTC correction even though it wasn't asked for. So either the VM is doing something odd in there or the DateTime code is. cc @kevmoo. |
Added Library-Core label. |
Florian writes: So it looks like succeeded was false and we just returned "0". |
The fact that we see this, and V8 doesn't, is that because we test it better then they do? |
There could be several reasons.
|
Are we going to do anything about this? This causes flakiness in the DateTime tests. I suppose I can change its date creation to create the date three times and go with the majority opinion, but that doesn't seem elegant. Changed the title to: "DateTime creation in local time zone uses UTC instead if getting the local time zone offset causes an error". |
I wonder if the call to 'localtime_r' can fail with E_INTR. We could try to check for it, and call again while errno == E_INTR. |
https://codereview.chromium.org/399973002 has an additional workaround for this in the Intl tests. |
Not stale. Still happens. |
We are, however, still not fixing it. |
We've occasionally seen flaking on Dartium on the round-trip date parsing tests where a date is printed one way and parsed back and the result fails. It seems that what's happening is that the resulting date is off from the desired one by the amount of a UTC correction. It particularly seems to happen on low information formats, e.g. just the month name or month and year. but that may just be coincidence.
An example failure is
Date mismatch!
Expected 7
Got 6
Original date = 2012-07-27 13:58:59.012
Original ms = 1343422739012
Parsed back to 1970-06-30 17:00:00.000
Parsed ms = 15638400000
Original tz = -7:00:00.000000
Current tz name =
Current tz = -7:00:00.000000
Current tz name =
Start time = 2013-12-06 15:34:23.363
Current time 2013-12-06 15:34:23.387
....
FAIL: Test round-trip parsing of dates
Expected: '7'
Actual: '6'
Which: is different.
Expected: 7
Actual: 6
^
Differ at offset 0
package:unittest/src/simple_configuration.dart 141:7 SimpleConfiguration.onExpectFailure
...
package:unittest/src/expect.dart 75:29 expect
../../../../root_dart/pkg/intl/test/date_time_format_test_core.dart 188:13 testRoundTripParsing
../../../../root_dart/pkg/intl/test/date_time_format_test_core.dart 261:29 runDateTests.<fn>
The text was updated successfully, but these errors were encountered: