Skip to content
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

Fix time period test that could result in a flake test within 15 days #527

Merged

Conversation

melonhead901
Copy link
Contributor

… of a DST change. The random_time function of the Faker::Time class works by rolling the clock forward a random number of hours until it's in the right period. For example, for afternoon the clock will be rolled forward 12 to 17 hours from midnight. However, when DST starts this will result in a time of 13:xx to 18:xx, because of the extra hour added by DST. The opposite effect happens when DST ends. On these days the random_time parameter thus has a chance to generate an off-by-one hour time. This bug seems too small to fix compared to the complexity of the fix. However, for 15 days before the end or start of DST (or 30 days per year), the test as currently written, will flake. This change eliminates the flake by fixing the dates used for the test as non-DST dates.

@vbrazo vbrazo force-pushed the master branch 5 times, most recently from a359def to a5d7731 Compare May 22, 2018 21:15
@vbrazo vbrazo merged commit cd70284 into faker-ruby:master Jul 12, 2018
@vbrazo vbrazo changed the title Fix time period test that could result in a flake test within 15 days… Fix time period test that could result in a flake test within 15 days Jul 12, 2018
@vbrazo vbrazo self-requested a review July 19, 2018 01:19
davidmorton0 pushed a commit to davidmorton0/faker that referenced this pull request Jul 12, 2021
faker-ruby#527)

* Fix time period test that could result in a flake test within 15 days of a DST change.

* Make perms match rest of files

* Comply with single quotes

* Fix time period test that could result in a flake test within 15 days of a DST change.

* Make perms match rest of files

Comply with single quotes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants