(proxy)
| 575 | |
| 576 | @pytest.mark.slow |
| 577 | async def test_reconnect_after_grow_failed(proxy): |
| 578 | # Retry reconnection after a failed connection attempt has put the pool |
| 579 | # in grow mode. See issue #370. |
| 580 | proxy.stop() |
| 581 | |
| 582 | ev = AEvent() |
| 583 | |
| 584 | def failed(pool): |
| 585 | ev.set() |
| 586 | |
| 587 | async with pool.AsyncConnectionPool( |
| 588 | proxy.client_dsn, min_size=4, reconnect_timeout=1.0, reconnect_failed=failed |
| 589 | ) as p: |
| 590 | assert await ev.wait_timeout(2.0) |
| 591 | |
| 592 | with pytest.raises(pool.PoolTimeout): |
| 593 | async with p.connection(timeout=0.5) as conn: |
| 594 | pass |
| 595 | |
| 596 | ev.clear() |
| 597 | assert await ev.wait_timeout(2.0) |
| 598 | |
| 599 | proxy.start() |
| 600 | |
| 601 | async with p.connection(timeout=2) as conn: |
| 602 | await conn.execute("select 1") |
| 603 | |
| 604 | await p.wait(timeout=3.0) |
| 605 | assert len(p._pool) == p.min_size == 4 |
| 606 | |
| 607 | |
| 608 | @pytest.mark.slow |
nothing calls this directly
no test coverage detected