(self)
| 338 | ) |
| 339 | |
| 340 | def test_no_wait_queue_timeout(self): |
| 341 | # Verify get_socket() with no wait_queue_timeout blocks forever. |
| 342 | pool = self.create_pool(max_pool_size=1) |
| 343 | self.addCleanup(pool.close) |
| 344 | |
| 345 | # Reach max_size. |
| 346 | with pool.checkout() as s1: |
| 347 | t = SocketGetter(self.c, pool) |
| 348 | t.start() |
| 349 | while t.state != "get_socket": |
| 350 | time.sleep(0.1) |
| 351 | |
| 352 | time.sleep(1) |
| 353 | self.assertEqual(t.state, "get_socket") |
| 354 | |
| 355 | while t.state != "connection": |
| 356 | time.sleep(0.1) |
| 357 | |
| 358 | self.assertEqual(t.state, "connection") |
| 359 | self.assertEqual(t.sock, s1) |
| 360 | # Cleanup |
| 361 | t.release_conn() |
| 362 | t.join() |
| 363 | pool.close() |
| 364 | |
| 365 | def test_checkout_more_than_max_pool_size(self): |
| 366 | pool = self.create_pool(max_pool_size=2) |
nothing calls this directly
no test coverage detected