mirror of
https://github.com/python/cpython.git
synced 2025-07-24 03:35:53 +00:00
Issue #28174: Handle when SO_REUSEPORT isn't properly supported (asyncio)
Patch by Seth Michael Larson.
This commit is contained in:
parent
a1b0e7db73
commit
5587d7c071
3 changed files with 27 additions and 12 deletions
|
@ -1370,6 +1370,17 @@ class BaseEventLoopWithSelectorTests(test_utils.TestCase):
|
|||
|
||||
self.assertRaises(ValueError, self.loop.run_until_complete, f)
|
||||
|
||||
@patch_socket
|
||||
def test_create_server_soreuseport_only_defined(self, m_socket):
|
||||
m_socket.getaddrinfo = socket.getaddrinfo
|
||||
m_socket.socket.return_value = mock.Mock()
|
||||
m_socket.SO_REUSEPORT = -1
|
||||
|
||||
f = self.loop.create_server(
|
||||
MyProto, '0.0.0.0', 0, reuse_port=True)
|
||||
|
||||
self.assertRaises(ValueError, self.loop.run_until_complete, f)
|
||||
|
||||
@patch_socket
|
||||
def test_create_server_cant_bind(self, m_socket):
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue