]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.11] gh-101384: Add socket timeout to ThreadedVSOCKSocketStreamTest and skip it...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sat, 17 Feb 2024 13:02:47 +0000 (14:02 +0100)
committerGitHub <noreply@github.com>
Sat, 17 Feb 2024 13:02:47 +0000 (15:02 +0200)
(cherry picked from commit 9fd420f53d1b1087d2ae648b0efc44107d27d867)

Co-authored-by: Peter Jiping Xie <peter.jp.xie@gmail.com>
Lib/test/test_socket.py

index 10eee5a37d366e874fb5d9215d29b408d4a39cb9..42adc573ecc2ead187a063c881d37f8abe38e72f 100644 (file)
@@ -45,6 +45,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
@@ -467,6 +468,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,
@@ -483,6 +485,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)