Skip to content

Commit 467c1e1

Browse files
committed
Do not hard fail in test_errorhandler.jl with unknown implementations
1 parent af96546 commit 467c1e1

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
@@ -25,24 +25,38 @@ istest(f) = endswith(f, ".jl") && startswith(f, "test_")
2525
testfiles = sort(filter(istest, readdir(testdir)))
2626

2727
@testset "$f" for f in testfiles
28-
mpiexec() do cmd
28+
mpiexec() do mpirun
29+
cmd = `$mpirun -n $nprocs $(Base.julia_cmd()) $(joinpath(testdir, f))`
2930
if f == "test_spawn.jl"
30-
run(`$cmd -n 1 $(Base.julia_cmd()) $(joinpath(testdir, f))`)
31+
# Some command as the others, but always use a single process
32+
_cmd = deepcopy(cmd)
33+
_cmd.exec[findfirst(==("$nprocs"), _cmd.exec)] = "1"
34+
run(_cmd)
3135
elseif f == "test_threads.jl"
3236
withenv("JULIA_NUM_THREADS" => "4") do
33-
run(`$cmd -n $nprocs $(Base.julia_cmd()) $(joinpath(testdir, f))`)
37+
run(cmd)
3438
end
3539
elseif f == "test_error.jl"
36-
r = run(ignorestatus(`$cmd -n $nprocs $(Base.julia_cmd()) $(joinpath(testdir, f))`))
40+
r = run(ignorestatus(cmd))
3741
@test !success(r)
42+
elseif f == "test_errorhandler.jl" && MPI.identify_implementation()[1] == MPI.UnknownMPI
43+
try
44+
run(cmd)
45+
catch e
46+
@error """
47+
$(f) tests failed. This may due to the fact this implementation of MPI doesn't support custom error handlers.
48+
See the full error message for more details. Some messages may have been written above.
49+
""" exception=(e, catch_backtrace())
50+
@test_broken false
51+
end
3852
else
3953
# MPI_Reduce with MPICH 3.4.2 on macOS when root != 0 and
4054
# when recvbuf == C_NULL segfaults
4155
# <https://github.com/pmodels/mpich/issues/5700>
4256
if get(ENV, "JULIA_MPI_TEST_DISABLE_REDUCE_ON_APPLE", "") != "" && Sys.isapple() && f == "test_reduce.jl"
4357
return
4458
end
45-
run(`$cmd -n $nprocs $(Base.julia_cmd()) $(joinpath(testdir, f))`)
59+
run(cmd)
4660
end
4761
@test true
4862
end

0 commit comments

Comments
 (0)