STINNER Victor <vstin...@python.org> added the comment:

Oh, by design, NetworkConnectionNoServer.test_create_connection() has a race 
condition:

        port = socket_helper.find_unused_port()
        with self.assertRaises(OSError) as cm:
            socket.create_connection((HOST, port))

If another process starts to listen to the "unused" port between 
find_unused_port() call and the create_connection() call, create_connection() 
succeed and the test fails.

Maybe I should just add a comment mentioning the race condition. Or we should 
find a more reliable way to get an error.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue40949>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to