From ebf44d523bc8f785cc7c0aaacb7d424fb77c3d4a Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Sun, 18 Oct 2026 08:23:38 +0200 Subject: [PATCH] fix: make the closed-pipe test meet a full pipe --- tests/test_audit_regressions.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/test_audit_regressions.py b/tests/test_audit_regressions.py index 8b483d2a..dd019b4e 100644 --- a/tests/test_audit_regressions.py +++ b/tests/test_audit_regressions.py @@ -3839,6 +3839,15 @@ class AReaderThatLeavesEarlyIsNoCrash(unittest.TestCase): [sys.executable, "scripts/verify.py", "--list-emulators"], cwd=ROOT, stdout=subprocess.PIPE, stderr=subprocess.PIPE, ) + # The listing fits a 64 KiB pipe: a child that wrote it all before + # the close below never met the broken pipe and exited 0. A 4 KiB + # pipe keeps it writing when the reader leaves. + try: + import fcntl # noqa: PLC0415 + + fcntl.fcntl(proc.stdout.fileno(), fcntl.F_SETPIPE_SZ, 4096) + except (ImportError, AttributeError, OSError): + pass proc.stdout.readline() proc.stdout.close() _, err = proc.communicate(timeout=120)