RESOLVED FIXED Bug 142531
[Win] 17 different JSC tests started to fail in DST
https://bugs.webkit.org/show_bug.cgi?id=142531
Summary [Win] 17 different JSC tests started to fail in DST
Csaba Osztrogonác
Reported 2015-03-10 05:43:55 PDT
Since daylight saving time is started in CA, 17 different date tests started to fail on Windows bots. (Apple Windows + WinCairo) jsc-layout-tests.yaml/js/script-tests/date-parse-comments-test.js.layout jsc-layout-tests.yaml/js/script-tests/date-parse-test.js.layout jsc-layout-tests.yaml/js/script-tests/date-set-to-nan.js.layout mozilla-tests.yaml/ecma/Date/15.9.3.1-1.js.mozilla mozilla-tests.yaml/ecma/Date/15.9.3.1-2.js.mozilla mozilla-tests.yaml/ecma/Date/15.9.3.1-3.js.mozilla mozilla-tests.yaml/ecma/Date/15.9.3.1-4.js.mozilla mozilla-tests.yaml/ecma/Date/15.9.3.1-5.js.mozilla mozilla-tests.yaml/ecma/Date/15.9.3.2-1.js.mozilla mozilla-tests.yaml/ecma/Date/15.9.3.2-2.js.mozilla mozilla-tests.yaml/ecma/Date/15.9.3.2-3.js.mozilla mozilla-tests.yaml/ecma/Date/15.9.3.2-4.js.mozilla mozilla-tests.yaml/ecma/Date/15.9.3.2-5.js.mozilla mozilla-tests.yaml/ecma/Date/15.9.4.2-1.js.mozilla mozilla-tests.yaml/ecma/Date/15.9.5.26-1.js.mozilla mozilla-tests.yaml/ecma/Date/15.9.5.27-1.js.mozilla mozilla-tests.yaml/ecma/Date/15.9.5.30-1.js.mozilla similar bugs: bug138303 and bug139123
Attachments
Patch (1.41 KB, patch)
2015-03-10 13:54 PDT, peavo
no flags
Patch (3.66 KB, patch)
2015-03-10 19:07 PDT, Brent Fulgham
no flags
Patch (3.42 KB, patch)
2015-03-10 19:09 PDT, Brent Fulgham
cdumez: review+
peavo
Comment 1 2015-03-10 13:04:10 PDT
This might be wrong, but I get zero stress test failures, with the diff below. It seems the documentation for GetTimeZoneInformation can be interpreted as the DST bias is already included in the bias member. Maybe someone can confirm? Index: DateMath.cpp =================================================================== --- DateMath.cpp (revisjon 181279) +++ DateMath.cpp (arbeidskopi) @@ -369,11 +369,7 @@ if (rc == TIME_ZONE_ID_INVALID) return 0; - int32_t bias = 0; - if (rc == TIME_ZONE_ID_DAYLIGHT) - bias = timeZoneInformation.Bias + timeZoneInformation.DaylightBias; - else if (rc == TIME_ZONE_ID_STANDARD || rc == TIME_ZONE_ID_UNKNOWN) - bias = timeZoneInformation.Bias + timeZoneInformation.StandardBias; + int32_t bias = timeZoneInformation.Bias; return -bias * 60 * 1000; #else
Alex Christensen
Comment 2 2015-03-10 13:33:24 PDT
I think you're right. Put up a patch and let Brent double check it. He wrote the code in question about 6 months ago, probably last time daylight savings time changed.
peavo
Comment 3 2015-03-10 13:54:34 PDT
Brent Fulgham
Comment 4 2015-03-10 14:13:30 PDT
(In reply to comment #2) > I think you're right. Put up a patch and let Brent double check it. He > wrote the code in question about 6 months ago, probably last time daylight > savings time changed. I don't think this is right. The calculation was working properly while we were in DST, so at the very least I would expect the 'correct' code to still do the Bias calculation including the "DaylightBias" value. According to <https://msdn.microsoft.com/en-us/library/windows/desktop/ms725481(v=vs.85).aspx>, StandardBias is normally zero. So "timeZoneInformation.Bias + timeZoneInformation.StandardBias" during standard time is equivalent to "timeZoneInformation.Bias".
Alex Christensen
Comment 5 2015-03-10 14:32:45 PDT
Well the current calculation is wrong right now. I wish there were an easy way to test this without waiting 6 months to see how things change. We should test this in Arizona, too :)
Brent Fulgham
Comment 6 2015-03-10 17:48:19 PDT
(In reply to comment #5) > Well the current calculation is wrong right now. I wish there were an easy > way to test this without waiting 6 months to see how things change. We > should test this in Arizona, too :) The current calculation is failing because 'GetTimeZoneInformation' is returning TIME_ZONE_ID_DAYLIGHT, instead of TIME_ZONE_ID_STANDARD. The date that DST ends varies from year-to-year. Apparently this didn't get updated on Windows, or maybe the function I'm calling isn't smart enough to account for this. According to MSDN, there is another function (in Vista and newer) that should do the right thing. I'll have to 'soft link' to it, since we don't know what OS we are running on, but that might fix it. I'll give it a try and see.
Brent Fulgham
Comment 7 2015-03-10 19:07:21 PDT
Brent Fulgham
Comment 8 2015-03-10 19:09:08 PDT
Chris Dumez
Comment 9 2015-03-10 19:15:24 PDT
Comment on attachment 248385 [details] Patch r=me
Brent Fulgham
Comment 10 2015-03-10 19:34:29 PDT
peavo
Comment 11 2015-03-11 00:02:55 PDT
(In reply to comment #6) > (In reply to comment #5) > > Well the current calculation is wrong right now. I wish there were an easy > > way to test this without waiting 6 months to see how things change. We > > should test this in Arizona, too :) > > The current calculation is failing because 'GetTimeZoneInformation' is > returning TIME_ZONE_ID_DAYLIGHT, instead of TIME_ZONE_ID_STANDARD. > > The date that DST ends varies from year-to-year. Apparently this didn't get > updated on Windows, or maybe the function I'm calling isn't smart enough to > account for this. > > According to MSDN, there is another function (in Vista and newer) that > should do the right thing. I'll have to 'soft link' to it, since we don't > know what OS we are running on, but that might fix it. > > I'll give it a try and see. Great :) I thought DST already had started in the US (8. of March), but I guess that was not the case :)
Note You need to log in before you can comment on or make changes to this bug.