Skip to content

Commit 7cb10d5

Browse files
authored
Merge pull request #542 from giordano/mg/handle-error-handler
Do not hard fail in `test_errorhandler.jl` with unknown implementations
2 parents 844d26e + 2ecd682 commit 7cb10d5

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(n=nprocs) = `$mpirun -n $n $(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+
run(cmd(1))
4244
elseif f == "test_threads.jl"
4345
withenv("JULIA_NUM_THREADS" => "4") do
44-
run(`$cmd -n $nprocs $(Base.julia_cmd()) $(joinpath(testdir, f))`)
46+
run(cmd())
4547
end
4648
elseif f == "test_error.jl"
47-
r = run(ignorestatus(`$cmd -n $nprocs $(Base.julia_cmd()) $(joinpath(testdir, f))`))
49+
r = run(ignorestatus(cmd()))
4850
@test !success(r)
51+
elseif f == "test_errorhandler.jl" && (MPI.identify_implementation()[1] == MPI.UnknownMPI ||
52+
# Fujitsu MPI is known to not work with custom error handlers
53+
startswith(MPI.MPI_LIBRARY_VERSION_STRING, "FUJITSU MPI"))
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)