Skip to content

Commit 4f25f08

Browse files
committed
fixup! Add a watcher mechanism to detect when Distributed might be in use
1 parent ec045ae commit 4f25f08

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

src/DistributedNext.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ function __init__()
141141
end
142142
end
143143

144-
sleep(0.5)
144+
sleep(0.2)
145145
end
146146
errormonitor(watcher_task)
147147
end

test/distributed_stdlib_detection.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@ using DistributedNext
22

33
@testset "Distributed.jl detection" begin
44
# Just loading Distributed should do nothing
5-
cmd = `$test_exename $test_exeflags -e 'using Distributed, DistributedNext; sleep(1)'`
5+
cmd = `$test_exename $test_exeflags -e 'using Distributed, DistributedNext; sleep(2)'`
66
stderr_buf = IOBuffer()
77
run(pipeline(cmd; stderr=stderr_buf))
88
stderr_str = String(take!(stderr_buf))
99
@test isempty(stderr_str)
1010

1111
# Only one of the two being active should also do nothing
12-
cmd = `$test_exename $test_exeflags -e 'using Distributed, DistributedNext; Distributed.init_multi(); sleep(1)'`
12+
cmd = `$test_exename $test_exeflags -e 'using Distributed, DistributedNext; Distributed.init_multi(); sleep(2)'`
1313
stderr_buf = IOBuffer()
1414
run(pipeline(cmd; stderr=stderr_buf))
1515
stderr_str = String(take!(stderr_buf))
1616
@test isempty(stderr_str)
1717

1818
# But both being active at the same time should trigger a warning
19-
cmd = `$test_exename $test_exeflags -e 'using Distributed, DistributedNext; Distributed.init_multi(); DistributedNext.init_multi(); sleep(1)'`
19+
cmd = `$test_exename $test_exeflags -e 'using Distributed, DistributedNext; Distributed.init_multi(); DistributedNext.init_multi(); sleep(2)'`
2020
stderr_buf = IOBuffer()
2121
run(pipeline(cmd; stderr=stderr_buf))
2222
stderr_str = String(take!(stderr_buf))

test/runtests.jl

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ include(joinpath(Sys.BINDIR, "..", "share", "julia", "test", "testenv.jl"))
88

99
cmd = `$test_exename $test_exeflags`
1010

11-
# LibSSH.jl currently only works on 64bit unixes
12-
if Sys.isunix() && Sys.WORD_SIZE == 64
13-
# Run the SSH tests with a single thread because LibSSH.jl is not thread-safe
14-
sshtestfile = joinpath(@__DIR__, "sshmanager.jl")
15-
run(addenv(`$cmd $sshtestfile`, "JULIA_NUM_THREADS" => "1"))
16-
else
17-
@warn "Skipping the SSH tests because this platform is not supported"
18-
end
11+
# # LibSSH.jl currently only works on 64bit unixes
12+
# if Sys.isunix() && Sys.WORD_SIZE == 64
13+
# # Run the SSH tests with a single thread because LibSSH.jl is not thread-safe
14+
# sshtestfile = joinpath(@__DIR__, "sshmanager.jl")
15+
# run(addenv(`$cmd $sshtestfile`, "JULIA_NUM_THREADS" => "1"))
16+
# else
17+
# @warn "Skipping the SSH tests because this platform is not supported"
18+
# end
1919

20-
include("distributed_exec.jl")
20+
# include("distributed_exec.jl")
2121

22-
include("managers.jl")
22+
# include("managers.jl")
2323

2424
include("distributed_stdlib_detection.jl")

0 commit comments

Comments
 (0)