Skip to content

Commit be715d7

Browse files
authored
gh-149879: Fix test_asyncio on Cygwin (#150416)
Skip tests on UNIX sockets since they hang on Cygwin.
1 parent 0065d22 commit be715d7

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

Lib/asyncio/unix_events.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -835,7 +835,8 @@ class _UnixSubprocessTransport(base_subprocess.BaseSubprocessTransport):
835835

836836
def _start(self, args, shell, stdin, stdout, stderr, bufsize, **kwargs):
837837
stdin_w = None
838-
if stdin == subprocess.PIPE and sys.platform.startswith('aix'):
838+
if (stdin == subprocess.PIPE
839+
and (sys.platform.startswith('aix') or sys.platform == 'cygwin')):
839840
# Use a socket pair for stdin on AIX, since it does not
840841
# support selecting read events on the write end of a
841842
# socket (which we use in order to detect closing of the

Lib/test/support/socket_helper.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,8 @@ def skip_unless_bind_unix_socket(test):
149149
"""Decorator for tests requiring a functional bind() for unix sockets."""
150150
if not hasattr(socket, 'AF_UNIX'):
151151
return unittest.skip('No UNIX Sockets')(test)
152+
if sys.platform == 'cygwin':
153+
return unittest.skip('UNIX sockets hang on Cygwin')(test)
152154
global _bind_nix_socket_error
153155
if _bind_nix_socket_error is None:
154156
from .os_helper import TESTFN, unlink

0 commit comments

Comments
 (0)