Skip to content

Commit 8657de2

Browse files
debug: loop flaky test
1 parent a2837c3 commit 8657de2

File tree

1 file changed

+20
-17
lines changed

1 file changed

+20
-17
lines changed

test/distributed_exec.jl

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -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
232236
end
233-
@test testval == 1
234237

235238
# Issue number #25847
236239
@everywhere function f25847(ref)

0 commit comments

Comments
 (0)