From d6c1a342f32d61ea1b8486b5f2e30728fc3e407b Mon Sep 17 00:00:00 2001 From: Matthew Zipkin Date: Tue, 14 Nov 2023 13:14:23 -0500 Subject: [PATCH] scenarios: force new http connection for evey RPC call --- src/warnet/test_framework_bridge.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/warnet/test_framework_bridge.py b/src/warnet/test_framework_bridge.py index f17eb96d4..cae40da50 100644 --- a/src/warnet/test_framework_bridge.py +++ b/src/warnet/test_framework_bridge.py @@ -6,6 +6,7 @@ import signal import sys import tempfile +from test_framework.authproxy import AuthServiceProxy from test_framework.p2p import NetworkThread from test_framework.test_framework import ( BitcoinTestFramework, @@ -17,6 +18,14 @@ from warnet.warnet import Warnet +# Ensure that all RPC calls are made with brand new http connections +def auth_proxy_request(self, method, path, postdata): + self._set_conn() # creates new http client connection + return self.oldrequest(method, path, postdata) +AuthServiceProxy.oldrequest = AuthServiceProxy._request +AuthServiceProxy._request = auth_proxy_request + + class WarnetTestFramework(BitcoinTestFramework): def set_test_params(self): pass