( )⚙ D9816 run-tests: catch a Windows specific error when testing for a free socket

This is an archive of the discontinued Mercurial Phabricator instance.

run-tests: catch a Windows specific error when testing for a free socket
ClosedPublic

Authored by mharbison72 on Jan 18 2021, 1:45 AM.

Details

Summary

I'm not sure why this only happens with py3, but this error code doesn't map to
any of the 3 currently being handled, and kills run-tests.py before it can run
any tests when it happens:

OSError: [WinError 10013] An attempt was made to access a socket in a way
forbidden by its access permissions

The documentation[1] says this can happen if another process is bound to the
address with exclusive access. This seems to keep it happy.

[1] https://docs.microsoft.com/en-us/windows/win32/winsock/windows-sockets-error-codes-2

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

mharbison72 created this revision.Jan 18 2021, 1:45 AM
pulkit accepted this revision.Jan 18 2021, 8:51 AM
This revision is now accepted and ready to land.Jan 18 2021, 8:51 AM