Skip to content

Commit e34106d

Browse files
add CachingPool remotecall_fetch test
1 parent 160f6c3 commit e34106d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/distributed_exec.jl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -713,6 +713,7 @@ pmap(_->myid(), 1:nworkers()) # priming run
713713
@test nworkers() == length(unique(remotecall_fetch(()->pmap(_->myid(), 1:100), id_other)))
714714

715715
# Same tests with custom worker pools.
716+
# WorkerPool
716717
wp = WorkerPool(workers())
717718
@test nworkers() == length(unique(pmap(_->myid(), wp, 1:100)))
718719
@test nworkers() == length(unique(remotecall_fetch(wp->pmap(_->myid(), wp, 1:100), id_other, wp)))
@@ -723,6 +724,17 @@ wp = WorkerPool(2:3)
723724
wp = WorkerPool(2:2)
724725
w = take!(wp)
725726

727+
# CachingPool
728+
wp = CachingPool(workers())
729+
@test nworkers() == length(unique(pmap(_->myid(), wp, 1:100)))
730+
@test nworkers() == length(unique(remotecall_fetch(wp->pmap(_->myid(), wp, 1:100), id_other, wp)))
731+
wp = CachingPool(2:3)
732+
@test sort(unique(pmap(_->myid(), wp, 1:100))) == [2,3]
733+
734+
# wait on caching pool
735+
wp = CachingPool(2:2)
736+
w = take!(wp)
737+
726738
# local call to _wait
727739
@test !isready(wp)
728740
t = @async wait(wp)

0 commit comments

Comments
 (0)