-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a watcher mechanism to detect when Distributed might be in use
This should help users figure out if one of their packages is using Distributed and another is using DistributedNext.
- Loading branch information
1 parent
13ce55b
commit ec045ae
Showing
6 changed files
with
67 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using DistributedNext | ||
|
||
@testset "Distributed.jl detection" begin | ||
# Just loading Distributed should do nothing | ||
cmd = `$test_exename $test_exeflags -e 'using Distributed, DistributedNext; sleep(1)'` | ||
stderr_buf = IOBuffer() | ||
run(pipeline(cmd; stderr=stderr_buf)) | ||
stderr_str = String(take!(stderr_buf)) | ||
@test isempty(stderr_str) | ||
|
||
# Only one of the two being active should also do nothing | ||
cmd = `$test_exename $test_exeflags -e 'using Distributed, DistributedNext; Distributed.init_multi(); sleep(1)'` | ||
stderr_buf = IOBuffer() | ||
run(pipeline(cmd; stderr=stderr_buf)) | ||
stderr_str = String(take!(stderr_buf)) | ||
@test isempty(stderr_str) | ||
|
||
# But both being active at the same time should trigger a warning | ||
cmd = `$test_exename $test_exeflags -e 'using Distributed, DistributedNext; Distributed.init_multi(); DistributedNext.init_multi(); sleep(1)'` | ||
stderr_buf = IOBuffer() | ||
run(pipeline(cmd; stderr=stderr_buf)) | ||
stderr_str = String(take!(stderr_buf)) | ||
@test contains(stderr_str, "DistributedNext has detected that the Distributed stdlib may be in use") | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters