Skip to content

Commit cd7678c

Browse files
authored
Distributed test suite: wrap another thread-unsafe test in poll_while (JuliaLang/julia#45037)
1 parent e5e570b commit cd7678c

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

test/distributed_exec.jl

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ function _getenv_include_thread_unsafe()
152152
return b
153153
end
154154
const _env_include_thread_unsafe = _getenv_include_thread_unsafe()
155-
function include_thread_unsafe()
155+
function include_thread_unsafe_tests()
156156
if Threads.nthreads() > 1
157157
if _env_include_thread_unsafe
158158
return true
@@ -260,8 +260,7 @@ remotecall_fetch(f25847, id_other, f)
260260

261261
finalize(f)
262262
yield() # flush gc msgs
263-
@test false == remotecall_fetch(chk_rrid->(yield(); haskey(Distributed.PGRP.refs, chk_rrid)), id_other, rrid)
264-
263+
@test poll_while(() -> remotecall_fetch(chk_rrid->(yield(); haskey(Distributed.PGRP.refs, chk_rrid)), id_other, rrid))
265264

266265
# Distributed GC tests for RemoteChannels
267266
function test_remoteref_dgc(id)
@@ -288,12 +287,12 @@ let wid1 = workers()[1],
288287
fstore = RemoteChannel(wid2)
289288

290289
put!(fstore, rr)
291-
if include_thread_unsafe()
290+
if include_thread_unsafe_tests()
292291
@test remotecall_fetch(k -> haskey(Distributed.PGRP.refs, k), wid1, rrid) == true
293292
end
294293
finalize(rr) # finalize locally
295294
yield() # flush gc msgs
296-
if include_thread_unsafe()
295+
if include_thread_unsafe_tests()
297296
@test remotecall_fetch(k -> haskey(Distributed.PGRP.refs, k), wid1, rrid) == true
298297
end
299298
remotecall_fetch(r -> (finalize(take!(r)); yield(); nothing), wid2, fstore) # finalize remotely

0 commit comments

Comments
 (0)