Skip to content

Commit 614f4c8

Browse files
wait for remote isready as a simpler test
1 parent 5cb33b9 commit 614f4c8

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/distributed_exec.jl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,16 @@ for i in 1:max_attempts
220220

221221
@test remotecall_fetch(k->haskey(Distributed.PGRP.refs, k), wid1, fid) == true
222222

223+
# fstore should be ready immediately, but races due to use of `@spawn` have caused
224+
# this to fail in the past. So we poll for readiness before the main test after this
225+
# which internally checks for `isready` to decide whether to error or not
226+
w = remotecall_fetch(wid2, fstore) do x
227+
timedwait(() -> isready(fetch(x)), 10)
228+
end
229+
w == :ok || @info "isready timed out on attempt $i (max $max_attempts)"
230+
@test w == :ok
231+
232+
# This is the actual test. It should fail because the value is already set remotely
223233
testval = remotecall_fetch(wid2, fstore) do x
224234
try
225235
put!(fetch(x), :OK)

0 commit comments

Comments
 (0)