Skip to content

Commit 3991db0

Browse files
[3.12] gh-101384: Add socket timeout to ThreadedVSOCKSocketStreamTest and skip it on WSL (GH-101419) (GH-115585)
(cherry picked from commit 9fd420f) Co-authored-by: Peter Jiping Xie <peter.jp.xie@gmail.com>
1 parent 23aef57 commit 3991db0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Lib/test/test_socket.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646

4747
VSOCKPORT = 1234
4848
AIX = platform.system() == "AIX"
49+
WSL = "microsoft-standard-WSL" in platform.release()
4950

5051
try:
5152
import _socket
@@ -481,6 +482,7 @@ def clientTearDown(self):
481482
ThreadableTest.clientTearDown(self)
482483

483484
@unittest.skipIf(fcntl is None, "need fcntl")
485+
@unittest.skipIf(WSL, 'VSOCK does not work on Microsoft WSL')
484486
@unittest.skipUnless(HAVE_SOCKET_VSOCK,
485487
'VSOCK sockets required for this test.')
486488
@unittest.skipUnless(get_cid() != 2,
@@ -497,6 +499,7 @@ def setUp(self):
497499
self.serv.bind((socket.VMADDR_CID_ANY, VSOCKPORT))
498500
self.serv.listen()
499501
self.serverExplicitReady()
502+
self.serv.settimeout(support.LOOPBACK_TIMEOUT)
500503
self.conn, self.connaddr = self.serv.accept()
501504
self.addCleanup(self.conn.close)
502505

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy