Skip to content

[Fix]: Flaky test - does not include an alert if that alert is also the banner alert - #3444

Merged
lvachon1 merged 1 commit into
mainfrom
lev/fix/flaky_alerts_test
Aug 21, 2026
Merged

[Fix]: Flaky test - does not include an alert if that alert is also the banner alert#3444
lvachon1 merged 1 commit into
mainfrom
lev/fix/flaky_alerts_test

Conversation

@lvachon1

Copy link
Copy Markdown
Contributor

Scope

Asana Ticket: 🛠️ Flaky test - does not include an alert if that alert is also the banner alert

Implementation

Found that there were ID collisions on the failing cases. The factory was only using :rand(0-999) for ids, and the test was randomly selecting 5. I upped the range to 0-9,999,999 since real alerts are in the seven digits anyway. While this will not entirely eliminate the flakyness of this test, it will make it happen way less often (1:250 to 1:2,500,000 by my math)

Added explanation and debug info for when the assertion eventually fails

Screenshots

N/A

How to test

mix test test/dotcom/alerts_test.exs --repeat-until-failure 500 - Confirm the test always passes. This takes a little over a minute on my machine, you can alter the 500 to fit how patient you are.

… was only using :rand(0-999) for ids, and the test was randomly selecting 5. I upped the range to 0-9,999,999 since real alerts are in the seven digits anyway. While this will not entirely eliminate the flakyness of this test, it will make it happen way less often (1:250 to 1:2,500,000 by my math)
@lvachon1
lvachon1 requested a review from a team as a code owner August 20, 2026 20:22
@lvachon1
lvachon1 requested a review from thecristen August 20, 2026 20:22
@lvachon1
lvachon1 merged commit 8960270 into main Aug 21, 2026
29 checks passed
@lvachon1
lvachon1 deleted the lev/fix/flaky_alerts_test branch August 21, 2026 17:48
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