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

Method test_timeout_05

tests/test_timeout.py:68–75  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

66 self.assertEqual(await self.con.fetch('select 1'), [(1,)])
67
68 async def test_timeout_05(self):
69 # Stress-test timeouts - try to trigger a race condition
70 # between a cancellation request to Postgres and next
71 # query (SELECT 1)
72 for _ in range(500):
73 with self.assertRaises(asyncio.TimeoutError):
74 await self.con.fetch('SELECT pg_sleep(1)', timeout=1e-10)
75 self.assertEqual(await self.con.fetch('SELECT 1'), [(1,)])
76
77 async def test_timeout_06(self):
78 async with self.con.transaction():

Callers

nothing calls this directly

Calls 1

fetchMethod · 0.45

Tested by

no test coverage detected