mirror of
https://github.com/python/cpython.git
synced 2025-10-04 22:20:46 +00:00
[3.12] gh-109015: Add test.support.socket_helper.tcp_blackhole() (GH-109016) (#109041)
gh-109015: Add test.support.socket_helper.tcp_blackhole() (GH-109016)
Skip test_asyncio, test_imaplib and test_socket tests if FreeBSD TCP
blackhole is enabled (net.inet.tcp.blackhole=2).
(cherry picked from commit a52a350977
)
Co-authored-by: Victor Stinner <vstinner@python.org>
This commit is contained in:
parent
579d782276
commit
c9dc2bc0de
7 changed files with 79 additions and 0 deletions
|
@ -671,6 +671,7 @@ class EventLoopTestsMixin:
|
|||
self.assertEqual(port, expected)
|
||||
tr.close()
|
||||
|
||||
@socket_helper.skip_if_tcp_blackhole
|
||||
def test_create_connection_local_addr_skip_different_family(self):
|
||||
# See https://github.com/python/cpython/issues/86508
|
||||
port1 = socket_helper.find_unused_port()
|
||||
|
@ -692,6 +693,7 @@ class EventLoopTestsMixin:
|
|||
with self.assertRaises(OSError):
|
||||
self.loop.run_until_complete(f)
|
||||
|
||||
@socket_helper.skip_if_tcp_blackhole
|
||||
def test_create_connection_local_addr_nomatch_family(self):
|
||||
# See https://github.com/python/cpython/issues/86508
|
||||
port1 = socket_helper.find_unused_port()
|
||||
|
@ -1271,6 +1273,7 @@ class EventLoopTestsMixin:
|
|||
|
||||
server.close()
|
||||
|
||||
@socket_helper.skip_if_tcp_blackhole
|
||||
def test_server_close(self):
|
||||
f = self.loop.create_server(MyProto, '0.0.0.0', 0)
|
||||
server = self.loop.run_until_complete(f)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue