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

Method test_pool_no_acquire_deadlock

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

Source from the content-addressed store, hash-verified

472 self.assertEqual(pool._queue.qsize(), 1)
473
474 async def test_pool_no_acquire_deadlock(self):
475 async with self.create_pool(database='postgres',
476 min_size=1, max_size=1,
477 max_queries=1) as pool:
478
479 async def sleep_and_release():
480 async with pool.acquire() as con:
481 await con.execute('SELECT pg_sleep(1)')
482
483 asyncio.ensure_future(sleep_and_release())
484 await asyncio.sleep(0.5)
485
486 async with pool.acquire() as con:
487 await con.fetchval('SELECT 1')
488
489 async def test_pool_config_persistence(self):
490 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