From fae760f2b24cb26494b65c0a7ac38b92ead345af Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Sat, 11 Apr 2020 21:37:09 -0400 Subject: [PATCH 1/4] cirrus: Bump freebsd to 12.1 --- .cirrus.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index f9c3d844bef..4a9bf845253 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -1,7 +1,7 @@ task: - name: "FreeBsd 12.0 amd64 [GOAL: install] [no depends, only system libs]" + name: "FreeBsd 12.1 amd64 [GOAL: install] [no depends, only system libs]" freebsd_instance: - image: freebsd-12-0-release-amd64 + image_family: freebsd-12-1 # https://cirrus-ci.org/guide/FreeBSD/ cpu: 8 memory: 8G timeout_in: 60m From fa9f4f663c36b0824406036445e5cff0a78174e9 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Sat, 11 Apr 2020 20:31:31 -0400 Subject: [PATCH 2/4] test: Remove python 3.4 workaround --- test/functional/test_framework/authproxy.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/test/functional/test_framework/authproxy.py b/test/functional/test_framework/authproxy.py index 4ba6ac1db20..c7837d3f6f0 100644 --- a/test/functional/test_framework/authproxy.py +++ b/test/functional/test_framework/authproxy.py @@ -105,16 +105,9 @@ class AuthServiceProxy(): try: self.__conn.request(method, path, postdata, headers) return self._get_response() - except http.client.BadStatusLine as e: - if e.line == "''": # if connection was closed, try again - self.__conn.close() - self.__conn.request(method, path, postdata, headers) - return self._get_response() - else: - raise except (BrokenPipeError, ConnectionResetError): - # Python 3.5+ raises BrokenPipeError instead of BadStatusLine when the connection was reset - # ConnectionResetError happens on FreeBSD with Python 3.4 + # Python 3.5+ raises BrokenPipeError when the connection was reset + # ConnectionResetError happens on FreeBSD self.__conn.close() self.__conn.request(method, path, postdata, headers) return self._get_response() From faa655731eac751d4eb494268e2c815493ba9382 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Sat, 11 Apr 2020 11:53:16 -0400 Subject: [PATCH 3/4] test: Document why connection is re-constructed on windows --- test/functional/test_framework/authproxy.py | 1 + 1 file changed, 1 insertion(+) diff --git a/test/functional/test_framework/authproxy.py b/test/functional/test_framework/authproxy.py index c7837d3f6f0..3a2c59ee5ee 100644 --- a/test/functional/test_framework/authproxy.py +++ b/test/functional/test_framework/authproxy.py @@ -101,6 +101,7 @@ class AuthServiceProxy(): if os.name == 'nt': # Windows somehow does not like to re-use connections # TODO: Find out why the connection would disconnect occasionally and make it reusable on Windows + # Avoid "ConnectionAbortedError: [WinError 10053] An established connection was aborted by the software in your host machine" self._set_conn() try: self.__conn.request(method, path, postdata, headers) From fab98992043f47fa7240d7c1217920d0c4f783a2 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Sat, 11 Apr 2020 20:29:35 -0400 Subject: [PATCH 4/4] test: Try once more when RPC connection fails on Windows --- test/functional/test_framework/authproxy.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/functional/test_framework/authproxy.py b/test/functional/test_framework/authproxy.py index 3a2c59ee5ee..05308931e3b 100644 --- a/test/functional/test_framework/authproxy.py +++ b/test/functional/test_framework/authproxy.py @@ -112,6 +112,15 @@ class AuthServiceProxy(): self.__conn.close() self.__conn.request(method, path, postdata, headers) return self._get_response() + except OSError as e: + retry = ( + '[WinError 10053] An established connection was aborted by the software in your host machine' in str(e)) + if retry: + self.__conn.close() + self.__conn.request(method, path, postdata, headers) + return self._get_response() + else: + raise def get_request(self, *args, **argsn): AuthServiceProxy.__id_count += 1