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