MCPcopy Create free account
hub / github.com/dask/dask / test_thread_safety

Function test_thread_safety

dask/tests/test_threaded.py:130–151  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

128
129
130def test_thread_safety():
131 def f(x):
132 return 1
133
134 dsk = {"x": (sleep, 0.05), "y": (f, "x")}
135
136 L = []
137
138 def test_f():
139 L.append(get(dsk, "y"))
140
141 threads = []
142 for _ in range(20):
143 t = threading.Thread(target=test_f)
144 t.daemon = True
145 t.start()
146 threads.append(t)
147
148 for thread in threads:
149 thread.join()
150
151 assert L == [1] * 20
152
153
154def test_interrupt():

Callers

nothing calls this directly

Calls 2

startMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected