]> granicus.if.org Git - python/commitdiff
bpo-32517: fix test_read_pty_output() hangs on macOS 10.13.2+ (GH-6037) (GH-6113)
authorNed Deily <nad@python.org>
Tue, 27 Mar 2018 21:16:49 +0000 (17:16 -0400)
committerGitHub <noreply@github.com>
Tue, 27 Mar 2018 21:16:49 +0000 (17:16 -0400)
test_asyncio hangs indefinitely on macOS 10.13.2+ on `read_pty_output()`
using the KqueueSelector. Closing `proto.transport` (as is done in
`write_pty_output()`) seems to fix it.
(cherry picked from commit 12f74d8608c15cacd9d5786524e2be9ca36f007e)

Co-authored-by: Nathan Henrie <n8henrie@users.noreply.github.com>
Also, re-enable test_read_pty_output on macOS.

Lib/test/test_asyncio/test_events.py
Misc/ACKS
Misc/NEWS.d/next/Tests/2018-03-09-07-05-12.bpo-32517.ugc1iW.rst [new file with mode: 0644]

index 6accbdae8b3e90a36c70df6a51c6e6794ca5f0f5..66c77b976dce1db537a84793e82d37eefb65458c 100644 (file)
@@ -1475,7 +1475,6 @@ class EventLoopTestsMixin:
 
     @unittest.skipUnless(sys.platform != 'win32',
                          "Don't support pipes for Windows")
-    @unittest.skipIf(sys.platform == 'darwin', 'test hangs on MacOS')
     def test_read_pty_output(self):
         proto = MyReadPipeProto(loop=self.loop)
 
@@ -1502,6 +1501,7 @@ class EventLoopTestsMixin:
         self.assertEqual(5, proto.nbytes)
 
         os.close(slave)
+        proto.transport.close()
         self.loop.run_until_complete(proto.done)
         self.assertEqual(
             ['INITIAL', 'CONNECTED', 'EOF', 'CLOSED'], proto.state)
index 05932a8d8991cac48b4787964873ccc44d531633..c7bdbd4a2312bc546345dd29cc30df11bd1d810b 100644 (file)
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -631,6 +631,7 @@ Thomas Heller
 Malte Helmert
 Lance Finn Helsten
 Jonathan Hendry
+Nathan Henrie
 Michael Henry
 James Henstridge
 Kasun Herath
diff --git a/Misc/NEWS.d/next/Tests/2018-03-09-07-05-12.bpo-32517.ugc1iW.rst b/Misc/NEWS.d/next/Tests/2018-03-09-07-05-12.bpo-32517.ugc1iW.rst
new file mode 100644 (file)
index 0000000..43f148f
--- /dev/null
@@ -0,0 +1,2 @@
+Fix failing ``test_asyncio`` on macOS 10.12.2+ due to transport of
+``KqueueSelector`` loop was not being closed.