From 07e2381cbb20517247168661d9076b2d49c647e4 Mon Sep 17 00:00:00 2001 From: Uriel Date: Sun, 8 Mar 2026 21:01:19 -0300 Subject: [PATCH] try to prevent busy-looping on create random port socket when doing test --- test/webhost/test_port_allocation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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()