Skip to content

Commit ca2bd3c

Browse files
wait for remote isready as a simpler test
1 parent 8657de2 commit ca2bd3c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/distributed_exec.jl

+10
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,16 @@ for i in 1:max_attempts
218218

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

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

0 commit comments

Comments
 (0)