]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
fixup! Port TCP high-water checks to Python
authorŠtěpán Balážik <stepan@isc.org>
Mon, 15 Jun 2026 20:48:04 +0000 (22:48 +0200)
committerŠtěpán Balážik <stepan@isc.org>
Tue, 16 Jun 2026 15:40:07 +0000 (17:40 +0200)
bin/tests/system/tcp/tests_tcp.py

index c94a348078a1605df096fbc2508499e6c6f06538..c952657165223c0a3fd65babbd84196fe7102c5c 100644 (file)
@@ -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(