243243 end
244244 end
245245 end
246- @test testval == 1
246+ @test timedwait (() -> testval == 1 , 10 ) == :ok
247247
248248 # Issue number #25847
249249 @everywhere function f25847 (ref)
722722 @test nworkers () == length (unique (remotecall_fetch (wp-> pmap (_-> myid (), wp, 1 : 100 ), id_other, wp)))
723723 wp = WorkerPool (2 : 3 )
724724 @test sort (unique (pmap (_-> myid (), wp, 1 : 100 ))) == [2 ,3 ]
725+ @test fetch (remotecall (myid, wp)) in wp. workers
726+ @test_throws RemoteException fetch (remotecall (error, wp))
725727
726728 # wait on worker pool
727729 wp = WorkerPool (2 : 2 )
747749 # CachingPool tests
748750 wp = CachingPool (workers ())
749751 @test [1 : 100 ... ] == pmap (x-> x, wp, 1 : 100 )
752+ @test fetch (remotecall (myid, wp)) in wp. workers
753+ @test_throws RemoteException fetch (remotecall (error, wp))
750754
751755 clear! (wp)
752756 @test length (wp. map_obj2ref) == 0
@@ -1017,15 +1021,19 @@ f16091b = () -> 1
10171021 # Test the behaviour of remotecall(f, ::AbstractWorkerPool), this should
10181022 # keep the worker out of the pool until the underlying remotecall has
10191023 # finished.
1020- remotechan = RemoteChannel (wrkr1)
1021- pool = WorkerPool ([wrkr1])
1022- put_future = remotecall (() -> wait (remotechan), pool)
1023- @test ! isready (pool)
1024- put! (remotechan, 1 )
1025- wait (put_future)
1026- # The task that waits on the future to put it back into the pool runs
1027- # asynchronously so we use timedwait() to check when the worker is back in.
1028- @test timedwait (() -> isready (pool), 10 ) === :ok
1024+ for PoolType in (WorkerPool, CachingPool)
1025+ let
1026+ remotechan = RemoteChannel (wrkr1)
1027+ pool = PoolType ([wrkr1])
1028+ put_future = remotecall (() -> wait (remotechan), pool)
1029+ @test ! isready (pool)
1030+ put! (remotechan, 1 )
1031+ wait (put_future)
1032+ # The task that waits on the future to put it back into the pool runs
1033+ # asynchronously so we use timedwait() to check when the worker is back in.
1034+ @test timedwait (() -> isready (pool), 10 ) === :ok
1035+ end
1036+ end
10291037
10301038 # Test calling @everywhere from a module not defined on the workers
10311039 LocalBar. bar ()
@@ -1707,18 +1715,17 @@ end
17071715 end
17081716
17091717 # Ensure that the code has indeed been successfully executed everywhere
1710- @test all (in (results), procs ())
1718+ return all (in (results), procs ())
17111719 end
17121720
17131721 # Test that the client port is reused. SO_REUSEPORT may not be supported on
17141722 # all UNIX platforms, Linux kernels prior to 3.9 and older versions of OSX
17151723 @assert nprocs () == 1
17161724 addprocs_with_testenv (4 ; lazy= false )
1717- if ccall (:jl_has_so_reuseport , Int32, ()) == 1
1718- reuseport_tests ()
1719- else
1720- @info " SO_REUSEPORT is unsupported, skipping reuseport tests"
1721- end
1725+
1726+ skip_reuseexport = ccall (:jl_has_so_reuseport , Int32, ()) != 1
1727+ skip_reuseexport && @debug " SO_REUSEPORT support missing, reuseport_tests skipped"
1728+ @test reuseport_tests () skip = skip_reuseexport
17221729end
17231730
17241731@testset " Even more various individual issues" begin
@@ -1848,19 +1855,19 @@ end
18481855 end
18491856 """
18501857 cmd = setenv (` $(julia) --project=$(project) -e $(testcode * extracode) ` , env)
1851- @test success (cmd)
1858+ @test success (pipeline ( cmd; stdout , stderr ) )
18521859 # JULIA_PROJECT
18531860 cmd = setenv (` $(julia) -e $(testcode * extracode) ` ,
18541861 (env[" JULIA_PROJECT" ] = project; env))
1855- @test success (cmd)
1862+ @test success (pipeline ( cmd; stdout , stderr ) )
18561863 # Pkg.activate(...)
18571864 activateish = """
18581865 Base.ACTIVE_PROJECT[] = $(repr (project))
18591866 using DistributedNext
18601867 addprocs(1)
18611868 """
18621869 cmd = setenv (` $(julia) -e $(activateish * testcode * extracode) ` , env)
1863- @test success (cmd)
1870+ @test success (pipeline ( cmd; stdout , stderr ) )
18641871 # JULIA_(LOAD|DEPOT)_PATH
18651872 shufflecode = """
18661873 d = reverse(DEPOT_PATH)
@@ -1879,7 +1886,7 @@ end
18791886 end
18801887 """
18811888 cmd = setenv (` $(julia) -e $(shufflecode * addcode * testcode * extracode) ` , env)
1882- @test success (cmd)
1889+ @test success (pipeline ( cmd; stdout , stderr ) )
18831890 # Mismatch when shuffling after proc addition. Note that the use of
18841891 # `addcode` mimics the behaviour of -p1 as the first worker is started
18851892 # before `shufflecode` executes.
@@ -1891,7 +1898,7 @@ end
18911898 end
18921899 """
18931900 cmd = setenv (` $(julia) -e $(failcode) ` , env)
1894- @test success (cmd)
1901+ @test success (pipeline ( cmd; stdout , stderr ) )
18951902
18961903 # Hideous hack to double escape path separators on Windows so that it gets
18971904 # interpolated into the string (and then Cmd) correctly.
@@ -1918,7 +1925,7 @@ end
19181925 end
19191926 """
19201927 cmd = setenv (` $(julia) -e $(envcode) ` , env)
1921- @test success (cmd)
1928+ @test success (pipeline ( cmd; stdout , stderr ) )
19221929 end end
19231930end
19241931
@@ -1935,7 +1942,7 @@ include("splitrange.jl")
19351942
19361943 # Next, ensure we get a log message when a worker does not cleanly exit
19371944 w = only (addprocs (1 ))
1938- @test_logs (:warn , r" sending SIGQUIT" ) begin
1945+ @test_logs (:warn , r" Sending SIGQUIT" ) match_mode = :any begin
19391946 remote_do (w) do
19401947 # Cause the 'exit()' message that `rmprocs()` sends to do nothing
19411948 Core. eval (Base, :(exit () = nothing ))
0 commit comments