mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-25 17:12:03 +00:00
Update test
This commit is contained in:
parent
1a43a8e1e7
commit
4de6a51545
@ -14,7 +14,13 @@ import subprocess
|
||||
import lzma
|
||||
|
||||
def get_local_port(host):
|
||||
with socket.socket() as fd:
|
||||
family = socket.AF_INET
|
||||
try:
|
||||
socket.inet_aton(host)
|
||||
except:
|
||||
family = socket.AF_INET6
|
||||
|
||||
with socket.socket(family) as fd:
|
||||
fd.bind((host, 0))
|
||||
return fd.getsockname()[1]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user