From ff613484095b47a205ea116372cecd5c68b5613c Mon Sep 17 00:00:00 2001 From: Giampaolo Rodola Date: Thu, 7 Feb 2019 10:46:29 +0100 Subject: Treat Lock and RLock differently. See: https://github.com/python/cpython/pull/11772#issuecomment-461343609 --- Lib/test/_test_multiprocessing.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py index d0a348a68f..2f839b9521 100644 --- a/Lib/test/_test_multiprocessing.py +++ b/Lib/test/_test_multiprocessing.py @@ -4815,14 +4815,17 @@ class TestSyncManagerTypes(unittest.TestCase): def test_lock(self, lname="Lock"): o = getattr(self.manager, lname)() self.run_worker(self._test_lock, o) - # See: https://ci.appveyor.com/project/python/cpython/builds/22183338 - if os.name == 'nt': - time.sleep(0.3) o.release() self.assertRaises(RuntimeError, o.release) # already released - def test_rlock(self): - self.test_lock(lname="RLock") + @classmethod + def _test_rlock(cls, obj): + obj.acquire() + obj.release() + + def test_rlock(self, lname="Lock"): + o = getattr(self.manager, lname)() + self.run_worker(self._test_rlock, o) @classmethod def _test_semaphore(cls, obj): @@ -4839,15 +4842,11 @@ class TestSyncManagerTypes(unittest.TestCase): @classmethod def _test_condition(cls, obj): obj.acquire() + obj.release() def test_condition(self): o = self.manager.Condition() self.run_worker(self._test_condition, o) - # See: https://ci.appveyor.com/project/python/cpython/builds/22183338 - if os.name == 'nt': - time.sleep(0.3) - o.release() - self.assertRaises(RuntimeError, o.release) # already released @classmethod def _test_barrier(cls, obj): -- cgit v1.2.1