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

Method test_pool_init_race

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

Source from the content-addressed store, hash-verified

1455 await pool.close()
1456
1457 async def test_pool_init_race(self):
1458 pool = self.create_pool(
1459 database='postgres',
1460 init_size=1,
1461 min_size=1,
1462 max_size=1,
1463 )
1464
1465 t1 = asyncio.ensure_future(pool)
1466 t2 = asyncio.ensure_future(pool)
1467
1468 await t1
1469 with self.assertRaisesRegex(
1470 asyncpg.InterfaceError,
1471 r'pool is being initialized in another task'):
1472 await t2
1473
1474 await pool.close()
1475
1476 async def test_pool_init_and_use_race(self):
1477 pool = self.create_pool(

Callers

nothing calls this directly

Calls 2

create_poolMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected