First get a new port, then close the offending.

This commit is contained in:
Pedro Algarvio 2016-05-23 16:33:29 +01:00
parent 659705becb
commit 580271d966
No known key found for this signature in database
GPG key ID: BB36BF6584A298FF

View file

@ -173,8 +173,9 @@ def get_unused_localhost_port():
port = usock.getsockname()[1]
if port in (54505, 54506, 64505, 64506, 64510, 64511):
# These ports are hardcoded in the test configuration
port = get_unused_localhost_port()
usock.close()
return get_unused_localhost_port()
return port
_RUNTESTS_PORTS[port] = usock