summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2024-02-17 13:03:04 (GMT)
committerGitHub <noreply@github.com>2024-02-17 13:03:04 (GMT)
commit3991db062e8df2ebcf22d25e37157da7678889a1 (patch)
treee8105fe88d63b8482689b82cdcb1521995faaabf
parent23aef575c7629abcd4aaf028ebd226fb41a4b3c8 (diff)
downloadcpython-3991db062e8df2ebcf22d25e37157da7678889a1.zip
cpython-3991db062e8df2ebcf22d25e37157da7678889a1.tar.gz
cpython-3991db062e8df2ebcf22d25e37157da7678889a1.tar.bz2
[3.12] gh-101384: Add socket timeout to ThreadedVSOCKSocketStreamTest and skip it on WSL (GH-101419) (GH-115585)
(cherry picked from commit 9fd420f53d1b1087d2ae648b0efc44107d27d867) Co-authored-by: Peter Jiping Xie <peter.jp.xie@gmail.com>
-rw-r--r--Lib/test/test_socket.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
index 4eb5af9..37f7fd5 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
@@ -481,6 +482,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,
@@ -497,6 +499,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)