Fix DST-flaky CronScheduleTest timezone test#4891
Merged
kgrgreer merged 2 commits intodevelopmentfrom Mar 9, 2026
Merged
Conversation
Hour 2 falls in the DST spring-forward gap (2 AM doesn't exist on transition day in America/Toronto), causing intermittent test failure. Use hour 10 which is unaffected by DST transitions.
Collaborator
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
CronScheduleTesttimezone test was intermittently failing near DST transitions. The test scheduled a cron job at 2:00 AM America/Toronto, but during the spring-forward DST transition, 2:00 AM doesn't exist (clocks jump from 1:59 AM to 3:00 AM). Java'sLocalDateTime.atZone()adjusts the non-existent time forward, causing theCalendar.HOUR_OF_DAYassertion to fail (expects 2, gets 3).Solution
Changed the test hour from 2 to 10, which is unaffected by DST transitions (spring-forward and fall-back both occur at 2:00 AM). The test still validates the same timezone conversion logic — just with an hour that always exists.
Changes
HOUR_OF_DAY == 2toHOUR_OF_DAY == 10. Added comment explaining the DST avoidance rationale.