Commit 23683c26 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

Test LockSet.acquire return value for timeout


Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
parent fc1baca9
......@@ -1002,10 +1002,12 @@ class TestLockSet(_ThreadedTestCase):
def _AcquireOne():
# Try to get the same lock again with a timeout (should never succeed)
if self.ls.acquire(wanted, timeout=0.1, shared=0):
acquired = self.ls.acquire(wanted, timeout=0.1, shared=0)
if acquired:
self.done.put("acquired")
self.ls.release()
else:
self.assert_(acquired is None)
self.assert_(not self.ls._list_owned())
self.assert_(not self.ls._is_owned())
self.done.put("not acquired")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment