Skip to content

Commit 96180a1

Browse files
committed
fix test_thread tests
1 parent 18f87c0 commit 96180a1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/test_thread.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,9 @@ def test_lock_acquire_timeout_timed_out(self):
195195
log.debug(" >>> thread 1 acquire")
196196
t1 = self._mk_locker(shared_lock, timeout=4, fail=False, name="timeout_t1")
197197
t1.emit_lock()
198-
sleep(0.2)
198+
# Check the LockCheck result from the thread queue
199+
res: LockCheck = t1.out_queue.get(block=True, timeout=2)
200+
self.assertTrue(res.was_locked)
199201
self.assertTrue(shared_lock.locked()) # Confirm our lock is locked
200202
# Now we try and acquire the lock with a second thread
201203
log.debug(" >>> thread 2 acquire (test lock timeout fail)")

0 commit comments

Comments
 (0)