MCPcopy Index your code
hub / github.com/dask/dask / test_thread_safety

Function test_thread_safety

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

startMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…