Skip to content

Commit 9a6b96f

Browse files
committed
Do not hard fail in test_errorhandler.jl with unknown implementations
1 parent 690378f commit 9a6b96f

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

test/runtests.jl

+19-5
Original file line numberDiff line numberDiff line change
@@ -34,24 +34,38 @@ istest(f) = endswith(f, ".jl") && startswith(f, "test_")
3434
testfiles = sort(filter(istest, readdir(testdir)))
3535

3636
@testset "$f" for f in testfiles
37-
mpiexec() do cmd
37+
mpiexec() do mpirun
38+
cmd = `$mpirun -n $nprocs $(Base.julia_cmd()) $(joinpath(testdir, f))`
3839
if f == "test_spawn.jl"
39-
run(`$cmd -n 1 $(Base.julia_cmd()) $(joinpath(testdir, f))`)
40+
# Some command as the others, but always use a single process
41+
_cmd = deepcopy(cmd)
42+
_cmd.exec[findfirst(==("$nprocs"), _cmd.exec)] = "1"
43+
run(_cmd)
4044
elseif f == "test_threads.jl"
4145
withenv("JULIA_NUM_THREADS" => "4") do
42-
run(`$cmd -n $nprocs $(Base.julia_cmd()) $(joinpath(testdir, f))`)
46+
run(cmd)
4347
end
4448
elseif f == "test_error.jl"
45-
r = run(ignorestatus(`$cmd -n $nprocs $(Base.julia_cmd()) $(joinpath(testdir, f))`))
49+
r = run(ignorestatus(cmd))
4650
@test !success(r)
51+
elseif f == "test_errorhandler.jl" && MPI.identify_implementation()[1] == MPI.UnknownMPI
52+
try
53+
run(cmd)
54+
catch e
55+
@error """
56+
$(f) tests failed. This may due to the fact this implementation of MPI doesn't support custom error handlers.
57+
See the full error message for more details. Some messages may have been written above.
58+
""" exception=(e, catch_backtrace())
59+
@test_broken false
60+
end
4761
else
4862
# MPI_Reduce with MPICH 3.4.2 on macOS when root != 0 and
4963
# when recvbuf == C_NULL segfaults
5064
# <https://github.com/pmodels/mpich/issues/5700>
5165
if get(ENV, "JULIA_MPI_TEST_DISABLE_REDUCE_ON_APPLE", "") != "" && Sys.isapple() && f == "test_reduce.jl"
5266
return
5367
end
54-
run(`$cmd -n $nprocs $(Base.julia_cmd()) $(joinpath(testdir, f))`)
68+
run(cmd)
5569
end
5670
@test true
5771
end

0 commit comments

Comments
 (0)