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 zone flakiness in distribution by county specs #4825

Merged

Conversation

coalest
Copy link
Collaborator

@coalest coalest commented Dec 3, 2024

Description

Apparently some of the specs I added were flaky in two different ways 🙃

Example of it failing in CI

Error message:

  1) Distributions by County handles time ranges properly works for prior year
     Failure/Error: expect(page).to have_css("table tbody tr td", text: "25", exact_text: true, count: 4)
       expected to find visible css "table tbody tr td" with exact text "25" 4 times but there were no matches. Also found "County 14", "50", "$525.00", "County 13", "50", "$525.00", "County 16", "50", "$525.00", "County 15", "50", "$525.00", "Unspecified", "0", "$0.00", which matched the selector but not all filters. 

     [Screenshot Image]: /home/runner/work/human-essentials/human-essentials/tmp/capybara/failures_r_spec_example_groups_distributions_by_county_handles_time_ranges_properly_works_for_prior_year_55.png


     # ./spec/system/distributions_by_county_system_spec.rb:58:in `block (3 levels) in <top (required)>'

Pretty sure this is a time zone issue. We query times in Los Angeles time zone during tests. But we were saving times in UTC to the database.

Type of change

  • Fix flaky spec

How Has This Been Tested?

Locally

Copy link
Collaborator

@dorner dorner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix!

@dorner dorner merged commit 56cb8cb into rubyforgood:main Dec 10, 2024
11 checks passed
Copy link
Contributor

@coalest: Your PR Fix time zone flakiness in distribution by county specs is part of today's Human Essentials production release: 2024.12.15.
Thank you very much for your contribution!

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

Successfully merging this pull request may close these issues.

2 participants