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

Method test_pool_init_race

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

Source from the content-addressed store, hash-verified

951 await pool.close()
952
953 async def test_pool_init_race(self):
954 pool = self.create_pool(database='postgres', min_size=1, max_size=1)
955
956 t1 = asyncio.ensure_future(pool)
957 t2 = asyncio.ensure_future(pool)
958
959 await t1
960 with self.assertRaisesRegex(
961 asyncpg.InterfaceError,
962 r'pool is being initialized in another task'):
963 await t2
964
965 await pool.close()
966
967 async def test_pool_init_and_use_race(self):
968 pool = self.create_pool(database='postgres', min_size=1, max_size=1)

Callers

nothing calls this directly

Calls 2

create_poolMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected