mirror of
https://github.com/python/cpython.git
synced 2026-01-04 14:32:21 +00:00
[3.11] gh-101384: Add socket timeout to ThreadedVSOCKSocketStreamTest and skip it on WSL (GH-101419) (GH-115586)
(cherry picked from commit 9fd420f53d)
Co-authored-by: Peter Jiping Xie <peter.jp.xie@gmail.com>
This commit is contained in:
parent
70754d21c2
commit
4077f1445c
1 changed files with 3 additions and 0 deletions
|
|
@ -45,6 +45,7 @@
|
|||
|
||||
VSOCKPORT = 1234
|
||||
AIX = platform.system() == "AIX"
|
||||
WSL = "microsoft-standard-WSL" in platform.release()
|
||||
|
||||
try:
|
||||
import _socket
|
||||
|
|
@ -467,6 +468,7 @@ def clientTearDown(self):
|
|||
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 @@ def setUp(self):
|
|||
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