Skip to content
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

Fix runtests for RemoteException capturing a UndefVarError case. #20210

Merged
merged 1 commit into from
Jan 25, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 19 additions & 20 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -154,35 +154,34 @@ cd(dirname(@__FILE__)) do
Base.Test.push_testset(fake)
Base.Test.record(o_ts, fake)
Base.Test.pop_testset()
elseif isa(res[2][1], RemoteException)
elseif isa(res[2][1], RemoteException) && isa(res[2][1].captured.ex, Base.Test.TestSetException)
println("Worker $(res[2][1].pid) failed running test $(res[1]):")
Base.showerror(STDOUT,res[2][1].captured)
o_ts.anynonpass = true
if isa(res[2][1].captured.ex, Base.Test.TestSetException)
fake = Base.Test.DefaultTestSet(res[1])
for i in 1:res[2][1].captured.ex.pass
Base.Test.record(fake, Base.Test.Pass(:test, nothing, nothing, nothing))
end
for i in 1:res[2][1].captured.ex.broken
Base.Test.record(fake, Base.Test.Broken(:test, nothing))
end
for t in res[2][1].captured.ex.errors_and_fails
Base.Test.record(fake, t)
end
Base.Test.push_testset(fake)
Base.Test.record(o_ts, fake)
Base.Test.pop_testset()
fake = Base.Test.DefaultTestSet(res[1])
for i in 1:res[2][1].captured.ex.pass
Base.Test.record(fake, Base.Test.Pass(:test, nothing, nothing, nothing))
end
for i in 1:res[2][1].captured.ex.broken
Base.Test.record(fake, Base.Test.Broken(:test, nothing))
end
for t in res[2][1].captured.ex.errors_and_fails
Base.Test.record(fake, t)
end
Base.Test.push_testset(fake)
Base.Test.record(o_ts, fake)
Base.Test.pop_testset()
elseif isa(res[2][1], Exception)
# If this test raised an exception that is not a RemoteException, that means
# the test runner itself had some problem, so we may have hit a segfault
# or something similar. Record this testset as Errored.
o_ts.anynonpass = true
# If this test raised an exception that is not a remote testset exception,
# i.e. not a RemoteException capturing a TestSetException that means
# the test runner itself had some problem, so we may have hit a segfault,
# deserialization errors or something similar. Record this testset as Errored.
fake = Base.Test.DefaultTestSet(res[1])
Base.Test.record(fake, Base.Test.Error(:test_error, res[1], res[2][1], []))
Base.Test.push_testset(fake)
Base.Test.record(o_ts, fake)
Base.Test.pop_testset()
else
error(string("Unknown result type : ", typeof(res)))
end
end
println()
Expand Down