

@gen_test
def test_get_clears_timed_out_getters(self):
    q = queues.Queue()
    getters = [q.get(timedelta(seconds=0.01)) for _ in range(10)]
    get = q.get()
    self.assertEqual(11, len(q._getters))
    (yield gen.sleep(0.02))
    self.assertEqual(11, len(q._getters))
    self.assertFalse(get.done())
    q.get()
    self.assertEqual(2, len(q._getters))
    for getter in getters:
        self.assertRaises(TimeoutError, getter.result)

dataset/ETHPy150Open tornadoweb/tornado/tornado/test/queues_test.py QueueGetTest.test_get_clears_timed_out_getters/original