MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_acquire_contended

Method test_acquire_contended

Lib/test/lock_tests.py:166–182  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

164
165 @unittest.skip("TODO: RUSTPYTHON; sometimes hangs")
166 def test_acquire_contended(self):
167 lock = self.locktype()
168 lock.acquire()
169 def f():
170 lock.acquire()
171 lock.release()
172
173 N = 5
174 with Bunch(f, N) as bunch:
175 # Threads block on lock.acquire()
176 wait_threads_blocked(N)
177 self.assertEqual(len(bunch.finished), 0)
178
179 # Threads unblocked
180 lock.release()
181
182 self.assertEqual(len(bunch.finished), N)
183
184 def test_with(self):
185 lock = self.locktype()

Callers

nothing calls this directly

Calls 6

wait_threads_blockedFunction · 0.85
lenFunction · 0.85
BunchClass · 0.70
acquireMethod · 0.45
assertEqualMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected