Skip to content

Commit 0e315ca

Browse files
authored
Merge pull request #212 from JuliaParallel/vc/jl13
make test less brittle
2 parents 5aaed0b + b6d8d3f commit 0e315ca

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

test/darray.jl

+9-2
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,13 @@ end
349349

350350
check_leaks()
351351

352+
unpack(ex::Base.CapturedException) = unpack(ex.ex)
353+
unpack(ex::Distributed.RemoteException) = unpack(ex.captured)
354+
if VERSION >= v"1.3.0-alpha.110"
355+
unpack(ex::Base.TaskFailedException) = unpack(ex.task.exception)
356+
end
357+
unpack(ex) = ex
358+
352359
@testset "test sum on DArrays" begin
353360
A = randn(100,100)
354361
DA = distribute(A)
@@ -361,7 +368,7 @@ check_leaks()
361368
@test !isempty(err.exceptions)
362369
for excep in err.exceptions
363370
# Unpack the remote exception
364-
orig_err = excep.ex.captured.ex
371+
orig_err = unpack(excep)
365372
@test isa(orig_err, ArgumentError)
366373
end
367374
else
@@ -375,7 +382,7 @@ check_leaks()
375382
@test !isempty(err.exceptions)
376383
for excep in err.exceptions
377384
# Unpack the remote exception
378-
orig_err = excep.ex.captured.ex
385+
orig_err = unpack(excep)
379386
@test isa(orig_err, ArgumentError)
380387
end
381388
else

0 commit comments

Comments
 (0)