Skip to content

Race condition in test_socket.testSockName #95243

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
rossburton opened this issue Jul 25, 2022 · 1 comment
Closed

Race condition in test_socket.testSockName #95243

rossburton opened this issue Jul 25, 2022 · 1 comment
Labels
tests Tests in the Lib/test dir triaged The issue has been accepted as valid by a triager. type-bug An unexpected behavior, bug, or error

Comments

@rossburton
Copy link
Contributor

testSockName has a race condition where find_unused_port() can return a port that gets used by another test in the meantime.

I have a patch, just waiting legal approval.

@rossburton rossburton added the type-bug An unexpected behavior, bug, or error label Jul 25, 2022
@mdboom mdboom added tests Tests in the Lib/test dir triaged The issue has been accepted as valid by a triager. labels Jul 25, 2022
rossburton added a commit to rossburton/cpython that referenced this issue Aug 22, 2022
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.
rossburton added a commit to rossburton/cpython that referenced this issue Aug 22, 2022
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 <[email protected]>
gpshead pushed a commit that referenced this issue Aug 25, 2022
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 <[email protected]>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Aug 25, 2022
…-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 <[email protected]>
(cherry picked from commit df11012)

Co-authored-by: Ross Burton <[email protected]>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Aug 25, 2022
…-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 <[email protected]>
(cherry picked from commit df11012)

Co-authored-by: Ross Burton <[email protected]>
miss-islington added a commit that referenced this issue Aug 25, 2022
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 <[email protected]>
(cherry picked from commit df11012)

Co-authored-by: Ross Burton <[email protected]>
miss-islington added a commit that referenced this issue Aug 25, 2022
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 <[email protected]>
(cherry picked from commit df11012)

Co-authored-by: Ross Burton <[email protected]>
@kumaraditya303
Copy link
Contributor

Fixed by #96173

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Tests in the Lib/test dir triaged The issue has been accepted as valid by a triager. type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants