Fix flaky distribution filtering by prior year spec #4823
Closed
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.
Description
Apparently some of the specs I added were flaky in two different ways 🙃
Example of it failing in CI
Error message:
In this case. what I think was happening is...
We want to test filtering by prior year. So we create a distribution on before last calendar year (ex: 12/31/2022), sometime last year (ex in year 2023), and on the first of the current year (1/1/2024).
For some year the test is matching two of those distributions instead of three.
Looking into how we determine the prior year in javascript, we are grabbing the time with local time zone (west coast for test suite), but UTC time in Ruby in the test suite so I think it could be a time zone issue.
Ruby example:
Javascript example (with change to
DateTime.utc()
shown)Type of change
How Has This Been Tested?
Locally
Screenshots