MCPcopy Create free account
hub / github.com/MagicStack/asyncpg / test_pool_release_timeout

Method test_pool_release_timeout

tests/test_adversity.py:69–78  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

67
68 @tb.with_timeout(30.0)
69 async def test_pool_release_timeout(self):
70 pool = await self.create_pool(
71 database='postgres', init_size=2, min_size=0, max_size=2)
72 try:
73 with self.assertRaises(asyncio.TimeoutError):
74 async with pool.acquire(timeout=0.5):
75 self.proxy.trigger_connectivity_loss()
76 finally:
77 self.proxy.restore_connectivity()
78 pool.terminate()
79
80 @tb.with_timeout(30.0)
81 async def test_pool_handles_abrupt_connection_loss(self):

Callers

nothing calls this directly

Calls 5

restore_connectivityMethod · 0.80
create_poolMethod · 0.45
acquireMethod · 0.45
terminateMethod · 0.45

Tested by

no test coverage detected