Skip to content

Commit 3a7e794

Browse files
committed
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
1 parent 8cf9d15 commit 3a7e794

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

test/functional/test_framework/authproxy.py

+2
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ def _request(self, method, path, postdata):
115115
except OSError as e:
116116
retry = (
117117
'[WinError 10053] An established connection was aborted by the software in your host machine' in str(e))
118+
# Workaround for a bug on macOS. See https://bugs.python.org/issue33450
119+
retry = retry or ('[Errno 41] Protocol wrong type for socket' in str(e))
118120
if retry:
119121
self.__conn.close()
120122
self.__conn.request(method, path, postdata, headers)

0 commit comments

Comments
 (0)