def test_get_cancelled_race(self):
    q = asyncio.Queue(loop=self.loop)
    t1 = asyncio.Task(q.get(), loop=self.loop)
    t2 = asyncio.Task(q.get(), loop=self.loop)
    test_utils.run_briefly(self.loop)
    t1.cancel()
    test_utils.run_briefly(self.loop)
    self.assertTrue(t1.done())
    q.put_nowait('a')
    test_utils.run_briefly(self.loop)
    self.assertEqual(t2.result(), 'a')
def test_get_cancelled_race(self):
    q = asyncio.Queue(loop=self.loop)
    t1 = asyncio.Task(q.get(), loop=self.loop)
    t2 = asyncio.Task(q.get(), loop=self.loop)
    test_utils.run_briefly(self.loop)
    t1.cancel()
    test_utils.run_briefly(self.loop)
    self.assertTrue(t1.done())
    q.put_nowait('a')
    test_utils.run_briefly(self.loop)
    self.assertEqual(t2.result(), 'a')