From: Guido van Rossum Date: Tue, 22 Oct 2013 04:28:45 +0000 (-0700) Subject: Fix asyncio issue #19293 (hangs on AIX). X-Git-Tag: v3.4.0b1~571^2~9 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b0fb94dda81ec21102f82ce7b149467db5cb02a3;p=python Fix asyncio issue #19293 (hangs on AIX). --- diff --git a/Lib/test/test_asyncio/test_events.py b/Lib/test/test_asyncio/test_events.py index 3924a2f996..98896e81d8 100644 --- a/Lib/test/test_asyncio/test_events.py +++ b/Lib/test/test_asyncio/test_events.py @@ -887,9 +887,6 @@ class EventLoopTestsMixin: @unittest.skipUnless(sys.platform != 'win32', "Don't support pipes for Windows") - # Issue #19293 - @unittest.skipIf(sys.platform.startswith("aix"), - 'cannot be interrupted with signal on AIX') def test_write_pipe_disconnect_on_close(self): proto = None transport = None @@ -899,8 +896,8 @@ class EventLoopTestsMixin: proto = MyWritePipeProto(loop=self.loop) return proto - rpipe, wpipe = os.pipe() - pipeobj = io.open(wpipe, 'wb', 1024) + rsock, wsock = self.loop._socketpair() + pipeobj = io.open(wsock.detach(), 'wb', 1024) @tasks.coroutine def connect(): @@ -916,11 +913,10 @@ class EventLoopTestsMixin: self.assertEqual('CONNECTED', proto.state) transport.write(b'1') - test_utils.run_briefly(self.loop) - data = os.read(rpipe, 1024) + data = self.loop.run_until_complete(self.loop.sock_recv(rsock, 1024)) self.assertEqual(b'1', data) - os.close(rpipe) + rsock.close() self.loop.run_until_complete(proto.done) self.assertEqual('CLOSED', proto.state)