From f908aba5bbbd0f37748e1ebe804401a3139bb809 Mon Sep 17 00:00:00 2001 From: "nekomimi.pet" Date: Sat, 31 Oct 2026 20:32:29 -0400 Subject: [PATCH] test: drain the editor test's pty until the CLI exits --- test/e2e/editor_test.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/e2e/editor_test.py b/test/e2e/editor_test.py index dcfd86eb..d2c00296 100644 --- a/test/e2e/editor_test.py +++ b/test/e2e/editor_test.py @@ -110,6 +110,15 @@ class EditorTest(unittest.TestCase): until(b"EDITOR_DONE") until(b"your messages") os.write(master, b"\x03") + # Keep reading: macOS's small pty buffer would otherwise block + # the CLI's last frames and its exit behind a full terminal. + deadline = time.monotonic() + 10 + while process.poll() is None and time.monotonic() < deadline: + if select.select([master], [], [], 0.1)[0]: + try: + os.read(master, 65536) + except OSError: + break self.assertEqual(process.wait(timeout=10), 0) finally: if process.poll() is None: -- knotmirror 0.0.1