Skip to content

Commit 14302a4

Browse files
committed
test: fix test abort for high timeout values (and --timeout-factor 0)
1 parent e191fac commit 14302a4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

test/functional/test_framework/authproxy.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,10 @@ def __init__(self, service_url, service_name=None, timeout=HTTP_TIMEOUT, connect
7878
passwd = None if self.__url.password is None else self.__url.password.encode('utf8')
7979
authpair = user + b':' + passwd
8080
self.__auth_header = b'Basic ' + base64.b64encode(authpair)
81-
self.timeout = timeout
81+
# clamp the socket timeout, since larger values can cause an
82+
# "Invalid argument" exception in Python's HTTP(S) client
83+
# library on some operating systems (e.g. OpenBSD, FreeBSD)
84+
self.timeout = min(timeout, 2147483)
8285
self._set_conn(connection)
8386

8487
def __getattr__(self, name):

0 commit comments

Comments
 (0)