-
Notifications
You must be signed in to change notification settings - Fork 25.2k
TimeZoneRoundingTests#testRoundingRandom fails reproducibly #20833
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
Comments
@cbuescher can you look |
I couldn't reproduce this on master with the given seed anymore, but going back to some earlier commit I was able get the random parameters that made the test trip in this case. Problem in that test occurs with:
Still need to do some digging what goes wrong here. |
@cbuescher Just a side note but I updated JodaTime to v2.9.5 recently and they fixed some bugs like JodaOrg/joda-time#373. Maybe related to this issue. |
I found the root cause for this. The test error reveals an interesting edge case with DST overlaps (happening usually on DST end, turning back the clock one hour) in combination with rounding to day intervals. In this particular case (tz: "Atlantic/Azores", dates around the DST transition on e.g. 2000-10-29T01:00:00.000Z) we currently get the overlapping part during the DST transition as a separate rounding interval as illustrated in this table:
According to https://www.timeanddate.com/time/change/portugal/horta?year=2000 the DST change happenes on Oct-29th at 1am local time, turning back the clock one hour (to offset -01:00). Currently the dates between "2000-10-29T00:00:00.000Z" and "2000-10-29T01:00:00.000Z" all round down to "2000-10-29T00:00:00.000Z" (before the transition) and the dates after but before next midnight round down to "2000-10-29T00:00:00.000-01:00". For a day rounding we would prefer a 25h hour bucket for "2000-10-29" to a one hour + another 24h bucket I guess. I think I have a fix that detects this kind of situation and merges the two intervals. |
When using TimeUnitRounding with a DAY_OF_MONTH unit, failing tests in elastic#20833 uncovered an issue when the DST shift happenes just one hour after midnight local time and sets back the clock to midnight, leading to an overlap. Previously this would lead to two different rounding values, depending on whether a date before or after the transition was rounded. This change detects this special case and correct for it by using the previous rounding date for both cases. Closes elastic#20833
When using TimeUnitRounding with a DAY_OF_MONTH unit, failing tests in #20833 uncovered an issue when the DST shift happenes just one hour after midnight local time and sets back the clock to midnight, leading to an overlap. Previously this would lead to two different rounding values, depending on whether a date before or after the transition was rounded. This change detects this special case and correct for it by using the previous rounding date for both cases. Closes #20833
When using TimeUnitRounding with a DAY_OF_MONTH unit, failing tests in #20833 uncovered an issue when the DST shift happenes just one hour after midnight local time and sets back the clock to midnight, leading to an overlap. Previously this would lead to two different rounding values, depending on whether a date before or after the transition was rounded. This change detects this special case and correct for it by using the previous rounding date for both cases. Closes #20833
The text was updated successfully, but these errors were encountered: