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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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

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.

1 participant