From fdddee1d08084b98c2a23fea01b537c05a6a0015 Mon Sep 17 00:00:00 2001 From: Amit Murthy Date: Wed, 25 Jan 2017 08:23:08 +0530 Subject: [PATCH] Fix runtests for RemoteException capturing a UndefVarError case. (#20210) --- test/runtests.jl | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/test/runtests.jl b/test/runtests.jl index ccaaf44948c21..6f723820e1052 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -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()