Conversation
giordano
commented
Jul 2, 2026
Comment on lines
+805
to
+838
| @testset "quickfail" begin | ||
| # To test that `--quickfail` does its job, we want to launch tests with one job, with | ||
| # the failing one launched as first: we should observe that the successful ones are | ||
| # never started. | ||
| testsuite = Dict( | ||
| "fail-test" => :( @test false ), | ||
| # If there's a bug in the launch order, having multiple successful tests increases | ||
| # the likelihood of hitting the bug, making investigation easier. | ||
| "pass-test1" => :( @test true ), | ||
| "pass-test2" => :( @test true ), | ||
| "pass-test3" => :( @test true ), | ||
| "pass-test4" => :( @test true ), | ||
| "pass-test5" => :( @test true ), | ||
| ) | ||
| io = IOBuffer() | ||
| @test_throws Test.FallbackTestSetException begin | ||
| # Call `_runtests` so that we can enforce a run order. | ||
| ParallelTestRunner._runtests( | ||
| # Use a single job to make sure only `fail-test` is started. | ||
| ParallelTestRunner, parse_args(["--quickfail", "--verbose", "--jobs=1"]); | ||
| testsuite, | ||
| tests=["fail-test", "pass-test1", "pass-test2", "pass-test3", "pass-test4", "pass-test5"], | ||
| historical_durations=Dict{String, Float64}(), | ||
| stdout=io, | ||
| stderr=io, | ||
| ) | ||
| end | ||
| str = String(take!(io)) | ||
| @test contains(str, r"fail-test .+ started at") | ||
| @test contains(str, r"fail-test .+ failed at") | ||
| @test contains(str, "FAILURE") | ||
| # `fail-test` is always launched first, `pass-test`s are never started. | ||
| @test !contains(str, r"pass-test[1-5] .+ started at") | ||
| end |
Collaborator
Author
There was a problem hiding this comment.
A simplified version of this test was originally in #118, but it didn't make sense back then because we had no way to enforce the tests launch order, so I removed it in that PR. I brought it back here, with more robust tests.
Note: if you run the tests with multiple julia threads, this fails very frequently because of #139 (the multiple pass-tests makes the failure much more likely than if having a single one).
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.
No description provided.