Skip to content

Commit 3b9e4fd

Browse files
authored
Merge pull request #118 from JuliaLang/racey-tests
Fix a race condition in the tests
2 parents 51fe0e4 + f9d3d89 commit 3b9e4fd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test/distributed_exec.jl

+3-1
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,9 @@ let wid1 = workers()[1],
295295

296296
put!(fstore, rr)
297297
if include_thread_unsafe_tests()
298-
@test remotecall_fetch(k -> haskey(Distributed.PGRP.refs, k), wid1, rrid) == true
298+
# timedwait() is necessary because wid1 is asynchronously informed of
299+
# the existence of rr/rrid through the call to `put!(fstore, rr)`.
300+
@test timedwait(() -> remotecall_fetch(k -> haskey(Distributed.PGRP.refs, k), wid1, rrid), 10) === :ok
299301
end
300302
finalize(rr) # finalize locally
301303
yield() # flush gc msgs

0 commit comments

Comments
 (0)