Skip to content

Commit 32f5bed

Browse files
author
aviau
committed
'time.sleep(0.1)' before returning free port
1 parent 3699c15 commit 32f5bed

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/influxdb/misc.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11

22

33
import socket
4+
import time
45

56

67
def get_free_port(ip='127.0.0.1'):
@@ -12,6 +13,10 @@ def get_free_port(ip='127.0.0.1'):
1213
finally:
1314
sock.close()
1415

16+
# Is there a better way than a sleep?
17+
# There were issues on Travis where the port was not yet free.
18+
time.sleep(0.1)
19+
1520

1621
def is_port_open(port, ip='127.0.0.1'):
1722
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

0 commit comments

Comments
 (0)