(self)
| 50 | |
| 51 | @tb.with_timeout(30.0) |
| 52 | async def test_pool_acquire_timeout(self): |
| 53 | pool = await self.create_pool( |
| 54 | database='postgres', init_size=2, min_size=0, max_size=2) |
| 55 | try: |
| 56 | self.proxy.trigger_connectivity_loss() |
| 57 | for _ in range(2): |
| 58 | with self.assertRaises(asyncio.TimeoutError): |
| 59 | async with pool.acquire(timeout=0.5): |
| 60 | pass |
| 61 | self.proxy.restore_connectivity() |
| 62 | async with pool.acquire(timeout=0.5): |
| 63 | pass |
| 64 | finally: |
| 65 | self.proxy.restore_connectivity() |
| 66 | pool.terminate() |
| 67 | |
| 68 | @tb.with_timeout(30.0) |
| 69 | async def test_pool_release_timeout(self): |
nothing calls this directly
no test coverage detected