mirror of
https://github.com/python/cpython.git
synced 2025-08-09 19:38:42 +00:00
[3.12] gh-101384: Add socket timeout to ThreadedVSOCKSocketStreamTest and skip it on WSL (GH-101419) (GH-115585)
(cherry picked from commit 9fd420f53d
)
Co-authored-by: Peter Jiping Xie <peter.jp.xie@gmail.com>
This commit is contained in:
parent
23aef575c7
commit
3991db062e
1 changed files with 3 additions and 0 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue