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

Method test_pool_no_acquire_deadlock

tests/test_pool.py:533–546  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

531 self.assertEqual(await replacement.fetchval('SELECT 1'), 1)
532
533 async def test_pool_no_acquire_deadlock(self):
534 async with self.create_pool(database='postgres',
535 init_size=1, min_size=1, max_size=1,
536 max_queries=1) as pool:
537
538 async def sleep_and_release():
539 async with pool.acquire() as con:
540 await con.execute('SELECT pg_sleep(1)')
541
542 asyncio.ensure_future(sleep_and_release())
543 await asyncio.sleep(0.5)
544
545 async with pool.acquire() as con:
546 await con.fetchval('SELECT 1')
547
548 async def test_pool_config_persistence(self):
549 N = 100

Callers

nothing calls this directly

Calls 3

create_poolMethod · 0.45
acquireMethod · 0.45
fetchvalMethod · 0.45

Tested by

no test coverage detected