aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorIvan Metlushko <metlushko@gmail.com>2020-06-24 17:49:04 +0700
committerIvan Metlushko <metlushko@gmail.com>2020-06-25 17:26:20 +0700
commit3a7e79478ab41af7c53ce14d9fca9815bffe1f73 (patch)
tree77afac9c22f5df01735a241f036df8482176a547 /test
parent8cf9d15b823d91d2a74fc83832fccca2219342c9 (diff)
downloadbitcoin-3a7e79478ab41af7c53ce14d9fca9815bffe1f73.tar.xz
test: retry when write to a socket fails on macOS
If the socket is tearing down macOS will return EPROTOTYPE instead of EPIPE. Because python doesn't handle this internally we have to do a workaround and retry the request. See https://bugs.python.org/issue33450
Diffstat (limited to 'test')
-rw-r--r--test/functional/test_framework/authproxy.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/functional/test_framework/authproxy.py b/test/functional/test_framework/authproxy.py
index 05308931e3..81eb881234 100644
--- a/test/functional/test_framework/authproxy.py
+++ b/test/functional/test_framework/authproxy.py
@@ -115,6 +115,8 @@ class AuthServiceProxy():
except OSError as e:
retry = (
'[WinError 10053] An established connection was aborted by the software in your host machine' in str(e))
+ # Workaround for a bug on macOS. See https://bugs.python.org/issue33450
+ retry = retry or ('[Errno 41] Protocol wrong type for socket' in str(e))
if retry:
self.__conn.close()
self.__conn.request(method, path, postdata, headers)