(self)
| 320 | pass |
| 321 | |
| 322 | def test_wait_queue_timeout(self): |
| 323 | wait_queue_timeout = 2 # Seconds |
| 324 | pool = self.create_pool(max_pool_size=1, wait_queue_timeout=wait_queue_timeout) |
| 325 | self.addCleanup(pool.close) |
| 326 | |
| 327 | with pool.checkout(): |
| 328 | start = time.time() |
| 329 | with self.assertRaises(ConnectionFailure): |
| 330 | with pool.checkout(): |
| 331 | pass |
| 332 | |
| 333 | duration = time.time() - start |
| 334 | self.assertLess( |
| 335 | abs(wait_queue_timeout - duration), |
| 336 | 1, |
| 337 | f"Waited {duration:.2f} seconds for a socket, expected {wait_queue_timeout:f}", |
| 338 | ) |
| 339 | |
| 340 | def test_no_wait_queue_timeout(self): |
| 341 | # Verify get_socket() with no wait_queue_timeout blocks forever. |
nothing calls this directly
no test coverage detected