aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2023-04-02 12:42:52 +0100
committerfanquake <fanquake@gmail.com>2023-04-02 12:54:37 +0100
commit88134fcee998849d9569368d6cefbfa487dc82d1 (patch)
tree5b877ef7d1ff57c723359fe7dc4408c7a81caf6b
parent8e9e2b4cb36dda0d5d04dc60e87fc11bc87fc803 (diff)
parentfae66fceb3147385320593d1e15faf290b0f4caf (diff)
downloadbitcoin-88134fcee998849d9569368d6cefbfa487dc82d1.tar.xz
Merge bitcoin/bitcoin#27378: test: Remove python3.5 workaround
fae66fceb3147385320593d1e15faf290b0f4caf test: Remove python3.5 workaround in authproxy (MarcoFalke) Pull request description: Remove workaround for a bug that is long fixed in a EOL python version, that isn't used by us. If the workaround is still needed, it should at least log the exception before silently discarding it, so that debugging is possible/easier. ACKs for top commit: fanquake: ACK fae66fceb3147385320593d1e15faf290b0f4caf Tree-SHA512: 9da28e495d530b9f9c5c75eff4982ef23b3775309e1f8d509722a9e7fd8b3535942c9a9cbd2d5e43e6487d46fdec4a63114aaa104e258c261cb98cb58560872a
-rwxr-xr-xtest/functional/feature_dbcrash.py8
-rw-r--r--test/functional/test_framework/authproxy.py23
-rw-r--r--test/functional/test_framework/util.py2
3 files changed, 10 insertions, 23 deletions
diff --git a/test/functional/feature_dbcrash.py b/test/functional/feature_dbcrash.py
index 1f2e0936ed..3f94bbc9d1 100755
--- a/test/functional/feature_dbcrash.py
+++ b/test/functional/feature_dbcrash.py
@@ -51,9 +51,11 @@ class ChainstateWriteCrashTest(BitcoinTestFramework):
self.supports_cli = False
# Set -maxmempool=0 to turn off mempool memory sharing with dbcache
- # Set -rpcservertimeout=900 to reduce socket disconnects in this
- # long-running test
- self.base_args = ["-limitdescendantsize=0", "-maxmempool=0", "-rpcservertimeout=900", "-dbbatchsize=200000"]
+ self.base_args = [
+ "-limitdescendantsize=0",
+ "-maxmempool=0",
+ "-dbbatchsize=200000",
+ ]
# Set different crash ratios and cache sizes. Note that not all of
# -dbcache goes to the in-memory coins cache.
diff --git a/test/functional/test_framework/authproxy.py b/test/functional/test_framework/authproxy.py
index 61f92aeac3..b798ec3ebd 100644
--- a/test/functional/test_framework/authproxy.py
+++ b/test/functional/test_framework/authproxy.py
@@ -94,8 +94,7 @@ class AuthServiceProxy():
def _request(self, method, path, postdata):
'''
- Do a HTTP request, with retry if we get disconnected (e.g. due to a timeout).
- This is a workaround for https://bugs.python.org/issue3566 which is fixed in Python 3.5.
+ Do a HTTP request.
'''
headers = {'Host': self.__url.hostname,
'User-Agent': USER_AGENT,
@@ -106,24 +105,8 @@ class AuthServiceProxy():
# 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)
- return self._get_response()
- except (BrokenPipeError, ConnectionResetError):
- # 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()
- except OSError as e:
- # Workaround for a bug on macOS. See https://bugs.python.org/issue33450
- retry = '[Errno 41] Protocol wrong type for socket' in str(e)
- if retry:
- self.__conn.close()
- self.__conn.request(method, path, postdata, headers)
- return self._get_response()
- else:
- raise
+ self.__conn.request(method, path, postdata, headers)
+ return self._get_response()
def get_request(self, *args, **argsn):
AuthServiceProxy.__id_count += 1
diff --git a/test/functional/test_framework/util.py b/test/functional/test_framework/util.py
index 9048a915b2..a1b90860f6 100644
--- a/test/functional/test_framework/util.py
+++ b/test/functional/test_framework/util.py
@@ -390,6 +390,8 @@ def write_config(config_path, *, n, chain, extra_config="", disable_autoconnect=
f.write("[{}]\n".format(chain_name_conf_section))
f.write("port=" + str(p2p_port(n)) + "\n")
f.write("rpcport=" + str(rpc_port(n)) + "\n")
+ # Disable server-side timeouts to avoid intermittent issues
+ f.write("rpcservertimeout=99000\n")
f.write("rpcdoccheck=1\n")
f.write("fallbackfee=0.0002\n")
f.write("server=1\n")