Skip to content

Commit 9fd420f

Browse files
authored
gh-101384: Add socket timeout to ThreadedVSOCKSocketStreamTest and skip it on WSL (GH-101419)
1 parent d2d7808 commit 9fd420f

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
@@ -510,6 +511,7 @@ def clientTearDown(self):
510511
ThreadableTest.clientTearDown(self)
511512

512513
@unittest.skipIf(fcntl is None, "need fcntl")
514+
@unittest.skipIf(WSL, 'VSOCK does not work on Microsoft WSL')
513515
@unittest.skipUnless(HAVE_SOCKET_VSOCK,
514516
'VSOCK sockets required for this test.')
515517
@unittest.skipUnless(get_cid() != 2,
@@ -526,6 +528,7 @@ def setUp(self):
526528
self.serv.bind((socket.VMADDR_CID_ANY, VSOCKPORT))
527529
self.serv.listen()
528530
self.serverExplicitReady()
531+
self.serv.settimeout(support.LOOPBACK_TIMEOUT)
529532
self.conn, self.connaddr = self.serv.accept()
530533
self.addCleanup(self.conn.close)
531534

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