Commit 96d94c21 authored by BAIRE Anthony's avatar BAIRE Anthony
Browse files

fix race conditions

parent ade01774
......@@ -1628,6 +1628,7 @@ class ManagerTestCase(unittest.TestCase):
actual_lst.append(("stop", id))
def _process(id, reset, rescheduled):
with lock:
self.assertNotIn(id, conditions)
......@@ -1917,9 +1918,9 @@ class ManagerTestCase(unittest.TestCase):
rescheduled[id] = rsc_fut
return fut.result()
manager = controller.Manager(2)
manager._process = lambda *k: manager.run_in_executor(worker, *k)
manager._process = asyncio.coroutine(
lambda *k: manager.run_in_executor(worker, *k))
......@@ -1957,6 +1958,8 @@ class ManagerTestCase(unittest.TestCase):
yield from asyncio.wait_for(fut, timeout=.1)
self.assertEquals(fut.result(), 43)
yield from asyncio.sleep(.1)
# since the task is restarted, the 'rescheduled' is recreated
Supports Markdown
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