Skip to content

Commit

Permalink
add logging test
Browse files Browse the repository at this point in the history
  • Loading branch information
simonbyrne committed Jan 17, 2023
1 parent 924755b commit 68a1681
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion stdlib/Distributed/test/distributed_exec.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file is a part of Julia. License is MIT: https://julialang.org/license

using Test, Distributed, Random, Serialization, Sockets
using Test, Distributed, Random, Serialization, Sockets, Logging
import Distributed: launch, manage

@test cluster_cookie() isa String
Expand Down Expand Up @@ -1876,6 +1876,18 @@ begin
end
end

# test logging
w = only(addprocs(1))
@test_logs (:info, "from pid $w") begin
prev_logger = global_logger(current_logger())
try
wait(@spawnat w @info("from pid $(myid())"))
finally
global_logger(prev_logger)
end
end
wait(rmprocs([w]))

# Run topology tests last after removing all workers, since a given
# cluster at any time only supports a single topology.
rmprocs(workers())
Expand Down

0 comments on commit 68a1681

Please sign in to comment.