diff options
author | Peter Jiping Xie <peter.jp.xie@gmail.com> | 2024-02-17 09:12:12 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-17 09:12:12 (GMT) |
commit | 9fd420f53d1b1087d2ae648b0efc44107d27d867 (patch) | |
tree | 8559a629be0c13e166ea6962c3b31eabc7cdd544 | |
parent | d2d78088530433f475d9304104bbc0dac2536edd (diff) | |
download | cpython-9fd420f53d1b1087d2ae648b0efc44107d27d867.zip cpython-9fd420f53d1b1087d2ae648b0efc44107d27d867.tar.gz cpython-9fd420f53d1b1087d2ae648b0efc44107d27d867.tar.bz2 |
gh-101384: Add socket timeout to ThreadedVSOCKSocketStreamTest and skip it on WSL (GH-101419)
-rw-r--r-- | Lib/test/test_socket.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py index 1796423..b936e9a 100644 --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@ -46,6 +46,7 @@ MSG = 'Michael Gilfix was here\u1234\r\n'.encode('utf-8') VSOCKPORT = 1234 AIX = platform.system() == "AIX" +WSL = "microsoft-standard-WSL" in platform.release() try: import _socket @@ -510,6 +511,7 @@ class ThreadedRDSSocketTest(SocketRDSTest, ThreadableTest): ThreadableTest.clientTearDown(self) @unittest.skipIf(fcntl is None, "need fcntl") +@unittest.skipIf(WSL, 'VSOCK does not work on Microsoft WSL') @unittest.skipUnless(HAVE_SOCKET_VSOCK, 'VSOCK sockets required for this test.') @unittest.skipUnless(get_cid() != 2, @@ -526,6 +528,7 @@ class ThreadedVSOCKSocketStreamTest(unittest.TestCase, ThreadableTest): self.serv.bind((socket.VMADDR_CID_ANY, VSOCKPORT)) self.serv.listen() self.serverExplicitReady() + self.serv.settimeout(support.LOOPBACK_TIMEOUT) self.conn, self.connaddr = self.serv.accept() self.addCleanup(self.conn.close) |