@@ -208,29 +208,32 @@ put!(f, :OK)
208
208
@test remotecall_fetch (k-> haskey (Distributed. PGRP. refs, k), wid1, fid) == false
209
209
@test fetch (f) === :OK
210
210
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
214
215
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
218
218
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
220
220
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
230
232
end
233
+ testval == 1 || @info " test failed on attempt $i (max $max_attempts )"
234
+ @test testval == 1
231
235
end
232
236
end
233
- @test testval == 1
234
237
235
238
# Issue number #25847
236
239
@everywhere function f25847 (ref)
0 commit comments