Skip to content

Commit d49b766

Browse files
committed
Chore: Fix probe_tcp_connect, by adding a low timeout
1 parent 0e4c401 commit d49b766

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

pytest_mqtt/util.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ def probe_tcp_connect(host: str, port: int) -> bool:
1515
https://github.com/lovelysystems/lovely.testlayers/blob/0.7.0/src/lovely/testlayers/util.py#L6-L13
1616
"""
1717
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
18+
s.settimeout(0.1)
1819
ex = s.connect_ex((host, port))
1920
if ex == 0:
2021
s.close()

0 commit comments

Comments
 (0)