From: Štěpán Balážik Date: Mon, 15 Jun 2026 20:48:04 +0000 (+0200) Subject: fixup! Port TCP high-water checks to Python X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=dccb9f4046aefbc9ef23c1faaa029a4dbfdb17a6;p=thirdparty%2Fbind9.git fixup! Port TCP high-water checks to Python --- diff --git a/bin/tests/system/tcp/tests_tcp.py b/bin/tests/system/tcp/tests_tcp.py index c94a348078a..c9526571652 100644 --- a/bin/tests/system/tcp/tests_tcp.py +++ b/bin/tests/system/tcp/tests_tcp.py @@ -102,7 +102,7 @@ class TcpConnectionPool: for task in tasks: task.cancel() results = await asyncio.gather(*tasks, return_exceptions=True) - await close_tcp_connections( + close_tcp_connections( result for result in results if isinstance(result, socket.socket) ) raise AssertionError(f"timed out opening {count} TCP connections") from exc @@ -112,7 +112,7 @@ class TcpConnectionPool: ] errors = [result for result in results if isinstance(result, BaseException)] if errors: - await close_tcp_connections(connections) + close_tcp_connections(connections) raise AssertionError( f"{len(errors)} TCP connection(s) failed: {errors[0]!r}" ) @@ -129,7 +129,7 @@ class TcpConnectionPool: closing = self.connections[:count] del self.connections[:count] - await close_tcp_connections(closing) + close_tcp_connections(closing) def create_socket(host: str, port: int) -> socket.socket: @@ -208,10 +208,9 @@ async def open_tcp_query_connection(host: str, port: int) -> socket.socket: return sock -async def close_tcp_connections(connections: Iterable[socket.socket]) -> None: +def close_tcp_connections(connections: Iterable[socket.socket]) -> None: for sock in connections: sock.close() - await asyncio.sleep(0) def wait_for_tcp_status(