]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-95243: Mitigate the race condition in testSockName (#96173)
authorRoss Burton <ross.burton@arm.com>
Thu, 25 Aug 2022 01:37:18 +0000 (02:37 +0100)
committerGitHub <noreply@github.com>
Thu, 25 Aug 2022 01:37:18 +0000 (18:37 -0700)
commitdf110126971d0271a977ce10779083b3e335b4da
tree2cb51687e1131c7621aa6b190c0b9c8bcde006ab
parente34c82abeb7ace09e6b5d116585c47cc372996c1
gh-95243: Mitigate the race condition in testSockName (#96173)

find_unused_port() has an inherent race condition, but we can't use
bind_port() as that uses .getsockname() which this test is exercising.

Try binding to unused ports a few times before failing.

Signed-off-by: Ross Burton <ross.burton@arm.com>
Lib/test/test_socket.py
Misc/NEWS.d/next/Tests/2022-08-22-14-59-42.gh-issue-95243.DeD66V.rst [new file with mode: 0644]