-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: add a "resilient" option to run all tests unconditionally #23589
Changes from 1 commit
f6b2469
694a075
b055f0b
5678082
60f4a95
e9bcb93
1b95220
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
Previously, this was the default: even if one test fails, all remaining tests are run nonetheless. Now this requires to pass the "--resilient" option to "test/runtests.jl" (or `resilient=true` to the `runtest` function); the new default is to stop running tests as soon as possible when there is one failure.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ using Base.Test | |
include("choosetests.jl") | ||
include("testenv.jl") | ||
|
||
tests, net_on = choosetests(ARGS) | ||
tests, net_on, resilient = choosetests(ARGS) | ||
tests = unique(tests) | ||
|
||
const max_worker_rss = if haskey(ENV, "JULIA_TEST_MAXRSS_MB") | ||
|
@@ -33,6 +33,7 @@ cd(dirname(@__FILE__)) do | |
n > 1 && addprocs_with_testenv(n) | ||
BLAS.set_num_threads(1) | ||
end | ||
skipped = 0 | ||
|
||
@everywhere include("testdefs.jl") | ||
|
||
|
@@ -59,14 +60,18 @@ cd(dirname(@__FILE__)) do | |
resp = [e] | ||
end | ||
push!(results, (test, resp)) | ||
if resp[1] isa Exception || resp[end] > max_worker_rss | ||
if resp[1] isa Exception | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sorry if this is stupid but why can't this be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No problem! If |
||
if !resilient | ||
skipped = length(tests) | ||
empty!(tests) | ||
end | ||
elseif resp[end] > max_worker_rss | ||
if n > 1 | ||
rmprocs(wrkr, waitfor=30) | ||
p = addprocs_with_testenv(1)[1] | ||
remotecall_fetch(include, p, "testdefs.jl") | ||
else | ||
# single process testing, bail if mem limit reached | ||
resp[1] isa Exception || error("Halting tests. Memory limit reached : $resp > $max_worker_rss") | ||
else # single process testing | ||
error("Halting tests. Memory limit reached : $resp > $max_worker_rss") | ||
end | ||
end | ||
if !isa(resp[1], Exception) | ||
|
@@ -181,7 +186,10 @@ cd(dirname(@__FILE__)) do | |
if !o_ts.anynonpass | ||
println(" \033[32;1mSUCCESS\033[0m") | ||
else | ||
println(" \033[31;1mFAILURE\033[0m") | ||
println(" \033[31;1mFAILURE\033[0m\n") | ||
skipped > 0 && | ||
println("$skipped test", skipped > 1 ? "s were" : " was", | ||
""" skipped due to failure (use the "resilient" option to run all tests unconditionally)\n""") | ||
Base.Test.print_test_errors(o_ts) | ||
throw(Test.FallbackTestSetException("Test run finished with errors")) | ||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe state here explicitly that if
resilient = true
all remaining tests in other files will be run?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, will clarify.