Skip to content

Commit 02fe4d5

Browse files
committed
fixup! Make worker state variable threadsafe
1 parent 8e35ba4 commit 02fe4d5

File tree

1 file changed

+2
-27
lines changed

1 file changed

+2
-27
lines changed

test/distributed_exec.jl

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -147,27 +147,6 @@ function poll_while(f::Function; timeout_seconds::Integer = 120)
147147
return true
148148
end
149149

150-
function _getenv_include_thread_unsafe()
151-
environment_variable_name = "JULIA_TEST_INCLUDE_THREAD_UNSAFE"
152-
default_value = "false"
153-
environment_variable_value = strip(get(ENV, environment_variable_name, default_value))
154-
b = parse(Bool, environment_variable_value)::Bool
155-
return b
156-
end
157-
const _env_include_thread_unsafe = _getenv_include_thread_unsafe()
158-
function include_thread_unsafe_tests()
159-
if Threads.maxthreadid() > 1
160-
if _env_include_thread_unsafe
161-
return true
162-
end
163-
msg = "Skipping a thread-unsafe test because `Threads.maxthreadid() > 1`"
164-
@warn msg Threads.maxthreadid()
165-
Test.@test_broken false
166-
return false
167-
end
168-
return true
169-
end
170-
171150
# DistributedNext GC tests for Futures
172151
function test_futures_dgc(id)
173152
f = remotecall(myid, id)
@@ -290,14 +269,10 @@ let wid1 = workers()[1],
290269
fstore = RemoteChannel(wid2)
291270

292271
put!(fstore, rr)
293-
if include_thread_unsafe_tests()
294-
@test remotecall_fetch(k -> haskey(DistributedNext.PGRP.refs, k), wid1, rrid) == true
295-
end
272+
@test remotecall_fetch(k -> haskey(DistributedNext.PGRP.refs, k), wid1, rrid) == true
296273
finalize(rr) # finalize locally
297274
yield() # flush gc msgs
298-
if include_thread_unsafe_tests()
299-
@test remotecall_fetch(k -> haskey(DistributedNext.PGRP.refs, k), wid1, rrid) == true
300-
end
275+
@test remotecall_fetch(k -> haskey(DistributedNext.PGRP.refs, k), wid1, rrid) == true
301276
remotecall_fetch(r -> (finalize(take!(r)); yield(); nothing), wid2, fstore) # finalize remotely
302277
sleep(0.5) # to ensure that wid2 messages have been executed on wid1
303278
@test poll_while(() -> remotecall_fetch(k -> haskey(DistributedNext.PGRP.refs, k), wid1, rrid))

0 commit comments

Comments
 (0)