(self)
| 731 | self.assertIsNot(pool._holders[0]._con, con) |
| 732 | |
| 733 | async def test_pool_max_inactive_time_03(self): |
| 734 | async with self.create_pool( |
| 735 | database='postgres', init_size=1, min_size=0, max_size=1, |
| 736 | max_inactive_connection_lifetime=1) as pool: |
| 737 | |
| 738 | # Test that we start counting inactive time *after* |
| 739 | # the connection is being released back to the pool. |
| 740 | |
| 741 | con = pool._holders[0]._con |
| 742 | |
| 743 | await pool.execute('SELECT pg_sleep(0.5)') |
| 744 | await asyncio.sleep(0.6) |
| 745 | |
| 746 | self.assertIs(pool._holders[0]._con, con) |
| 747 | |
| 748 | self.assertEqual( |
| 749 | await pool.execute('SELECT 1::int'), |
| 750 | 'SELECT 1') |
| 751 | self.assertIs(pool._holders[0]._con, con) |
| 752 | |
| 753 | async def test_pool_max_inactive_time_04(self): |
| 754 | # Chaos test for max_inactive_connection_lifetime. |
nothing calls this directly
no test coverage detected