Skip to content

Commit

Permalink
Merge pull request #16095 from JuliaLang/amitm/detect_err_cause
Browse files Browse the repository at this point in the history
Request to Test: detect cause of #16091
  • Loading branch information
tkelman committed May 3, 2016
2 parents 118662d + 48e969c commit 14ec987
Showing 1 changed file with 27 additions and 3 deletions.
30 changes: 27 additions & 3 deletions test/examples.jl
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,37 @@ end
dc_path = joinpath(dir, "dictchannel.jl")
myid() == 1 || include(dc_path)

# The checks to see if DictChannel is defined is to identify the root cause of
# https://github.com/JuliaLang/julia/issues/16091 .
# To be removed once fixed.
defined_on_worker = false
if (myid() != 1) && !isdefined(:DictChannel)
error("myid : $(myid()). DictChannel not defined.")
else
defined_on_worker = true
end

# Run the remote on pid 1, since runtests may terminate workers
# at any time depending on memory usage
remotecall_fetch(1, dc_path) do f
@test remotecall_fetch(1, dc_path) do f
include(f)
nothing
return :infungible
end === :infungible

defined_on_master = false
if remotecall_fetch(isdefined, 1, :DictChannel) == false
error("myid : $(myid()). DictChannel not defined on 1")
else
defined_on_master = true
end

dc = nothing
try
dc=RemoteChannel(()->DictChannel(), 1)
catch e
println("myid : ", myid(), ", dc_path : ", dc_path, ", defined_on_worker:", defined_on_worker, ", defined_on_master: ", defined_on_master)
rethrow(e)
end
dc=RemoteChannel(()->DictChannel(), 1)
@test typeof(dc) == RemoteChannel{DictChannel}

@test isready(dc) == false
Expand Down

0 comments on commit 14ec987

Please sign in to comment.