Repository navigation
test: start the test repo once to fix flaky setup_all failures - #225
Merged
zachdaniel merged 1 commit intoOct 20, 2026
Merged
Conversation
Contributor
|
🚀 Thank you for your contribution! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
CI on
mainintermittently ends withN tests, 0 failures, 2–5 invalid: one module'ssetup_allfails with(e.g. runs 39450958371, 38788849819, 38503023987, 33346691045, 33293567334). The module varies.
Seven test modules call
AshOban.Test.Repo.start_link()insetup_alland ignore the result. The repo gets linked to thesetup_allprocess of whichever module started it first, and ExUnit only stops that process's linked children asynchronously after the module finishes. The next module'sstart_link()can return{:error, {:already_started, _}}just before the old repo goes down, and thenOban.start_link/1finds no repo.This starts the repo once in
test_helper.exsand drops the per-module calls.Reproducing
--repeat-until-failureruns the suite repeatedly in one VM.VerifyUseTenantFromRecordTestdefines modules inside its tests and fails on any second iteration, so it has to be excluded:On
main, 11 out of 11 trials (seeds 564897 and 1–10) produced invalid modules, after 12–289 iterations (median 31). Across 992 iterations that is about 1 in 90, so 500 repeats miss it about 0.4% of the time. With this change, seeds 564897 and 1–3 ran all 501 iterations each (2004 in total) with no failures or invalid modules.