From 2742c3428633b6ceaab6714635dc3adb74bf121b Mon Sep 17 00:00:00 2001 From: Harris Date: Sun, 3 May 2020 01:42:40 +0200 Subject: test: add factor option to adjust test timeouts Co-authored-by: MarcoFalke --- test/functional/test_framework/test_framework.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test/functional/test_framework/test_framework.py') diff --git a/test/functional/test_framework/test_framework.py b/test/functional/test_framework/test_framework.py index 8719bd0d39..107836991c 100755 --- a/test/functional/test_framework/test_framework.py +++ b/test/functional/test_framework/test_framework.py @@ -101,6 +101,7 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass): self.bind_to_localhost_only = True self.set_test_params() self.parse_args() + self.rpc_timeout = int(self.rpc_timeout * self.options.factor) # optionally, increase timeout by a factor def main(self): """Main function. This should not be overridden by the subclass test scripts.""" @@ -167,6 +168,7 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass): help="set a random seed for deterministically reproducing a previous test run") parser.add_argument("--descriptors", default=False, action="store_true", help="Run test using a descriptor wallet") + parser.add_argument('--factor', type=float, default=1.0, help='adjust test timeouts by a factor') self.add_options(parser) self.options = parser.parse_args() @@ -412,6 +414,7 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass): chain=self.chain, rpchost=rpchost, timewait=self.rpc_timeout, + factor=self.options.factor, bitcoind=binary[i], bitcoin_cli=binary_cli[i], version=versions[i], @@ -558,6 +561,7 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass): extra_args=['-disablewallet'], rpchost=None, timewait=self.rpc_timeout, + factor=self.options.factor, bitcoind=self.options.bitcoind, bitcoin_cli=self.options.bitcoincli, coverage_dir=None, -- cgit v1.2.3