

@gen_test
def test_get_clears_timed_out_putters(self):
    q = queues.Queue(1)
    putters = [q.put(i, timedelta(seconds=0.01)) for i in range(10)]
    put = q.put(10)
    self.assertEqual(10, len(q._putters))
    (yield gen.sleep(0.02))
    self.assertEqual(10, len(q._putters))
    self.assertFalse(put.done())
    q.put(11)
    self.assertEqual(0, (yield q.get()))
    self.assertEqual(1, len(q._putters))
    for putter in putters[1:]:
        self.assertRaises(TimeoutError, putter.result)

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