summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuido van Rossum <guido@dropbox.com>2013-10-22 04:28:45 (GMT)
committerGuido van Rossum <guido@dropbox.com>2013-10-22 04:28:45 (GMT)
commitb0fb94dda81ec21102f82ce7b149467db5cb02a3 (patch)
tree8398f834d46d7f6f72c8b474f79268cdf1def7d1
parentf75debda9476841c5b0661f8e133133125d91258 (diff)
downloadcpython-b0fb94dda81ec21102f82ce7b149467db5cb02a3.zip
cpython-b0fb94dda81ec21102f82ce7b149467db5cb02a3.tar.gz
cpython-b0fb94dda81ec21102f82ce7b149467db5cb02a3.tar.bz2
Fix asyncio issue #19293 (hangs on AIX).
-rw-r--r--Lib/test/test_asyncio/test_events.py12
1 files changed, 4 insertions, 8 deletions
diff --git a/Lib/test/test_asyncio/test_events.py b/Lib/test/test_asyncio/test_events.py
index 3924a2f..98896e8 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)