From: Štěpán Balážik Date: Thu, 16 Jul 2026 20:08:51 +0000 (+0200) Subject: fixup! Port the long TCP stream test to Python X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=19264da4db63cd5a6dd2094498ca61e4e956f000;p=thirdparty%2Fbind9.git fixup! Port the long TCP stream test to Python --- diff --git a/bin/tests/system/tcp/tests_tcp.py b/bin/tests/system/tcp/tests_tcp.py index 6d80208ca9b..766ed66ca59 100644 --- a/bin/tests/system/tcp/tests_tcp.py +++ b/bin/tests/system/tcp/tests_tcp.py @@ -258,15 +258,25 @@ async def send_long_tcp_stream( reader, writer = await asyncio.open_connection(host, port) discard_task = asyncio.create_task(discard_stream(reader)) try: - remaining = frames_remaining - while remaining > 0: - frames = min(chunk_frames, remaining) - writer.write(frame * frames) + # The server may close the connection before we have written the + # whole stream. This shows up notably on Alma Linux 8: under + # concurrent load its small default TCP buffers let the flow + # control between us and named wedge, named then hits its idle + # timeout and resets the connection mid-write, and drain() raises + # ConnectionResetError. That is fine -- the connection being torn + # down is acceptable and the only thing this test asserts is that + # named survives the flood, which the query below checks -- so + # tolerate the server closing the connection early. + with contextlib.suppress(ConnectionResetError): + remaining = frames_remaining + while remaining > 0: + frames = min(chunk_frames, remaining) + writer.write(frame * frames) + await writer.drain() + remaining -= frames + + writer.write_eof() await writer.drain() - remaining -= frames - - writer.write_eof() - await writer.drain() writer.close() with contextlib.suppress(ConnectionError, OSError):