

def test_maxsize_release(self):
    pool = Pool(url='ws://localhost:8182/', maxsize=2, username='stephen', password='password', future_class=Future)

    @trollius.coroutine
    def go():
        c1 = (yield From(pool.acquire()))
        c2 = (yield From(pool.acquire()))
        c3 = pool.acquire()
        self.assertIsInstance(c3, Future)
        with self.assertRaises(trollius.TimeoutError):
            shielded_fut = trollius.shield(c3)
            (yield From(trollius.wait_for(shielded_fut, 0.1)))
        (yield From(pool.release(c2)))
        c3 = (yield From(c3))
        self.assertEqual(c2, c3)
        c1.conn.close()
        c2.conn.close()
        c3.conn.close()
    self.loop.run_until_complete(go())

dataset/ETHPy150Open davebshow/gremlinclient/tests/test_trollius.py TrolliusPoolTest.test_maxsize_release/original