Skip to content

Commit

Permalink
Chore: Fix probe_tcp_connect, by adding a low timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
amotl committed Mar 29, 2024
1 parent 0e4c401 commit d49b766
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pytest_mqtt/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ def probe_tcp_connect(host: str, port: int) -> bool:
https://github.com/lovelysystems/lovely.testlayers/blob/0.7.0/src/lovely/testlayers/util.py#L6-L13
"""
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.settimeout(0.1)
ex = s.connect_ex((host, port))
if ex == 0:
s.close()
Expand Down

0 comments on commit d49b766

Please sign in to comment.