@@ -208,29 +208,32 @@ put!(f, :OK)
208208@test remotecall_fetch (k-> haskey (Distributed. PGRP. refs, k), wid1, fid) == false
209209@test fetch (f) === :OK
210210
211- # RemoteException should be thrown on a put! when another process has set the value
212- f = Future (wid1)
213- fid = remoteref_id (f)
211+ max_attempts = 1000
212+ for i in 1 : max_attempts
213+ let f = Future (wid1), fid = remoteref_id (f), fstore = RemoteChannel (wid2)
214+ # RemoteException should be thrown on a put! when another process has set the value
214215
215- fstore = RemoteChannel (wid2)
216- put! (fstore, f) # send f to wid2
217- put! (f, :OK ) # set value from master
216+ put! (fstore, f) # send f to wid2
217+ put! (f, :OK ) # set value from master
218218
219- @test remotecall_fetch (k-> haskey (Distributed. PGRP. refs, k), wid1, fid) == true
219+ @test remotecall_fetch (k-> haskey (Distributed. PGRP. refs, k), wid1, fid) == true
220220
221- testval = remotecall_fetch (wid2, fstore) do x
222- try
223- put! (fetch (x), :OK )
224- return 0
225- catch e
226- if isa (e, RemoteException)
227- return 1
228- else
229- return 2
221+ testval = remotecall_fetch (wid2, fstore) do x
222+ try
223+ put! (fetch (x), :OK )
224+ return 0
225+ catch e
226+ if isa (e, RemoteException)
227+ return 1
228+ else
229+ rethrow ()
230+ end
231+ end
230232 end
233+ testval == 1 || @info " test failed on attempt $i (max $max_attempts )"
234+ @test testval == 1
231235 end
232236end
233- @test testval == 1
234237
235238# Issue number #25847
236239@everywhere function f25847 (ref)
0 commit comments