diff --git a/test/webhost/test_port_allocation.py b/test/webhost/test_port_allocation.py index 76727ae5cd..b9fed9fbd6 100644 --- a/test/webhost/test_port_allocation.py +++ b/test/webhost/test_port_allocation.py @@ -84,7 +84,7 @@ class TestPortAllocating(unittest.TestCase): s.close() sockets.clear() - for _ in range(30_000): + for _ in range(30_000 - (len(get_used_ports()) + 100)): socket = create_random_port_socket(("30000-65535",), "127.0.0.1") sockets.append(socket) _, port = socket.getsockname()