|
722 | 722 | @test nworkers() == length(unique(remotecall_fetch(wp->pmap(_->myid(), wp, 1:100), id_other, wp)))
|
723 | 723 | wp = WorkerPool(2:3)
|
724 | 724 | @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)) |
725 | 727 |
|
726 | 728 | # wait on worker pool
|
727 | 729 | wp = WorkerPool(2:2)
|
|
747 | 749 | # CachingPool tests
|
748 | 750 | wp = CachingPool(workers())
|
749 | 751 | @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)) |
750 | 754 |
|
751 | 755 | clear!(wp)
|
752 | 756 | @test length(wp.map_obj2ref) == 0
|
@@ -1017,15 +1021,19 @@ f16091b = () -> 1
|
1017 | 1021 | # Test the behaviour of remotecall(f, ::AbstractWorkerPool), this should
|
1018 | 1022 | # keep the worker out of the pool until the underlying remotecall has
|
1019 | 1023 | # 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 |
1029 | 1037 |
|
1030 | 1038 | # Test calling @everywhere from a module not defined on the workers
|
1031 | 1039 | LocalBar.bar()
|
|
0 commit comments