Skip to content

Commit 8534d53

Browse files
authored
bpo-32517: fix test_read_pty_output() hangs on macOS 10.13.2+ (GH-6037) (GH-6113)
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 12f74d8) Co-authored-by: Nathan Henrie <[email protected]> Also, re-enable test_read_pty_output on macOS.
1 parent 30e507d commit 8534d53

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

Lib/test/test_asyncio/test_events.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1475,7 +1475,6 @@ async def connect():
14751475

14761476
@unittest.skipUnless(sys.platform != 'win32',
14771477
"Don't support pipes for Windows")
1478-
@unittest.skipIf(sys.platform == 'darwin', 'test hangs on MacOS')
14791478
def test_read_pty_output(self):
14801479
proto = MyReadPipeProto(loop=self.loop)
14811480

@@ -1502,6 +1501,7 @@ async def connect():
15021501
self.assertEqual(5, proto.nbytes)
15031502

15041503
os.close(slave)
1504+
proto.transport.close()
15051505
self.loop.run_until_complete(proto.done)
15061506
self.assertEqual(
15071507
['INITIAL', 'CONNECTED', 'EOF', 'CLOSED'], proto.state)

Misc/ACKS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -631,6 +631,7 @@ Thomas Heller
631631
Malte Helmert
632632
Lance Finn Helsten
633633
Jonathan Hendry
634+
Nathan Henrie
634635
Michael Henry
635636
James Henstridge
636637
Kasun Herath
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix failing ``test_asyncio`` on macOS 10.12.2+ due to transport of
2+
``KqueueSelector`` loop was not being closed.

0 commit comments

Comments
 (0)