Skip to content

Commit 14ec987

Browse files
committed
Merge pull request #16095 from JuliaLang/amitm/detect_err_cause
Request to Test: detect cause of #16091
2 parents 118662d + 48e969c commit 14ec987

File tree

1 file changed

+27
-3
lines changed

1 file changed

+27
-3
lines changed

test/examples.jl

+27-3
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,37 @@ end
4747
dc_path = joinpath(dir, "dictchannel.jl")
4848
myid() == 1 || include(dc_path)
4949

50+
# The checks to see if DictChannel is defined is to identify the root cause of
51+
# https://github.com/JuliaLang/julia/issues/16091 .
52+
# To be removed once fixed.
53+
defined_on_worker = false
54+
if (myid() != 1) && !isdefined(:DictChannel)
55+
error("myid : $(myid()). DictChannel not defined.")
56+
else
57+
defined_on_worker = true
58+
end
59+
5060
# Run the remote on pid 1, since runtests may terminate workers
5161
# at any time depending on memory usage
52-
remotecall_fetch(1, dc_path) do f
62+
@test remotecall_fetch(1, dc_path) do f
5363
include(f)
54-
nothing
64+
return :infungible
65+
end === :infungible
66+
67+
defined_on_master = false
68+
if remotecall_fetch(isdefined, 1, :DictChannel) == false
69+
error("myid : $(myid()). DictChannel not defined on 1")
70+
else
71+
defined_on_master = true
72+
end
73+
74+
dc = nothing
75+
try
76+
dc=RemoteChannel(()->DictChannel(), 1)
77+
catch e
78+
println("myid : ", myid(), ", dc_path : ", dc_path, ", defined_on_worker:", defined_on_worker, ", defined_on_master: ", defined_on_master)
79+
rethrow(e)
5580
end
56-
dc=RemoteChannel(()->DictChannel(), 1)
5781
@test typeof(dc) == RemoteChannel{DictChannel}
5882

5983
@test isready(dc) == false

0 commit comments

Comments
 (0)