Skip to content

Commit

Permalink
wait for remote isready as a simpler test
Browse files Browse the repository at this point in the history
  • Loading branch information
IanButterworth committed Jan 26, 2025
1 parent 8657de2 commit ca2bd3c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/distributed_exec.jl
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,16 @@ for i in 1:max_attempts

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

# fstore should be ready immediately, but races due to use of `@spawn` have caused
# this to fail in the past. So we poll for readiness before the main test after this
# which internally checks for `isready` to decide whether to error or not
w = remotecall_fetch(wid2, fstore) do x
timedwait(() -> isready(fetch(x)), 10)
end
w == :ok || @info "isready timed out on attempt $i (max $max_attempts)"
@test w == :ok

# This is the actual test. It should fail because the value is already set remotely
testval = remotecall_fetch(wid2, fstore) do x
try
put!(fetch(x), :OK)
Expand Down

0 comments on commit ca2bd3c

Please sign in to comment.