Skip to content

Commit 65fac37

Browse files
committed
Do not hard fail in test_errorhandler.jl with unknown implementations
1 parent 5cf57d8 commit 65fac37

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

test/runtests.jl

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,24 +36,38 @@ istest(f) = endswith(f, ".jl") && startswith(f, "test_")
3636
testfiles = sort(filter(istest, readdir(testdir)))
3737

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

0 commit comments

Comments
 (0)