Skip to content

Fix time zone flakiness in distribution by county specs#4825

Merged
dorner merged 1 commit intorubyforgood:mainfrom
coalest:fix-flaky-prior-year-date-picker-spec
Dec 10, 2024
Merged

Fix time zone flakiness in distribution by county specs#4825
dorner merged 1 commit intorubyforgood:mainfrom
coalest:fix-flaky-prior-year-date-picker-spec

Conversation

@coalest
Copy link
Copy Markdown
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
Copy Markdown
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
@github-actions
Copy link
Copy Markdown
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