mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-03 17:30:25 +01:00
test: add factor option to adjust test timeouts
Co-authored-by: MarcoFalke <falke.marco@gmail.com>
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user