Nir Soffer has posted comments on this change.
Change subject: tests: Add basic tests for RWLock ......................................................................
Patch Set 1:
(3 comments)
https://gerrit.ovirt.org/#/c/42772/1/tests/miscTests.py File tests/miscTests.py:
Line 1274: Line 1275: def test_multiple_acquire(self): Line 1276: lock = misc.RWLock() Line 1277: self.assertTrue(lock.acquire(exclusive=True)) Line 1278: self.assertTrue(lock.acquire(exclusive=True)) I don't think these tests are correct without the next patch - lock.acquire() returns always None. Line 1279: Line 1280: def test_demote(self): Line 1281: lock = misc.RWLock() Line 1282: self.assertTrue(lock.acquire(exclusive=True))
Line 1279: Line 1280: def test_demote(self): Line 1281: lock = misc.RWLock() Line 1282: self.assertTrue(lock.acquire(exclusive=True)) Line 1283: self.assertTrue(lock.acquire(exclusive=False)) Same Line 1284: Line 1285: def test_promote(self): Line 1286: lock = misc.RWLock() Line 1287: self.assertTrue(lock.acquire(False))
Line 1283: self.assertTrue(lock.acquire(exclusive=False)) Line 1284: Line 1285: def test_promote(self): Line 1286: lock = misc.RWLock() Line 1287: self.assertTrue(lock.acquire(False)) Same