Skip to content

Commit 5ef1603

Browse files
author
MarcoFalke
committed
Merge #21410: test: increase rpc_timeout for fundrawtx test_transaction_too_large
d09120b test: give fundraw more time for test_transaction_too_large (Jon Atack) Pull request description: to hopefully fix timeouts from a new test added in 48a0319 of #20536 merged March 8, 2021 seen locally when running via the test runner ``` File "/home/jon/projects/bitcoin/bitcoin/test/functional/rpc_fundrawtransaction.py", line 927, in test_transaction_too_large raise JSONRPCException({ test_framework.authproxy.JSONRPCException: 'generatetoaddress' RPC took longer than 30.000000 seconds. Consider using larger timeout for calls that take longer to return. (-344) ``` and in the CI like https://bitcoinbuilds.org/index.php?ansilog=28537952-2c92-46f2-9871-8918e5ba2738.log#l2398 ``` File "/home/ubuntu/src/test/functional/rpc_fundrawtransaction.py", line 927, in test_transaction_too_large test_framework.authproxy.JSONRPCException: 'generatetoaddress' RPC took longer than 240.000000 seconds. Consider using larger timeout for calls that take longer to return. (-344) ``` Top commit has no ACKs. Tree-SHA512: f11c923439014fe12420f986c640fd301a26282eb41516957d73b9c751087cbae3d0e316f9ccb49bcb424f488540266f70d3f97948633e77c62bd7935df90452
2 parents 01bb3af + d09120b commit 5ef1603

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

test/functional/rpc_fundrawtransaction.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ def set_test_params(self):
3232
# This test isn't testing tx relay. Set whitelist on the peers for
3333
# instant tx relay.
3434
self.extra_args = [['[email protected]']] * self.num_nodes
35+
self.rpc_timeout = 90 # to prevent timeouts in `test_transaction_too_large`
3536

3637
def skip_test_if_missing_module(self):
3738
self.skip_if_no_wallet()
@@ -910,22 +911,23 @@ def test_subtract_fee_with_presets(self):
910911

911912
def test_transaction_too_large(self):
912913
self.log.info("Test fundrawtx where BnB solution would result in a too large transaction, but Knapsack would not")
913-
914914
self.nodes[0].createwallet("large")
915915
wallet = self.nodes[0].get_wallet_rpc(self.default_wallet_name)
916916
recipient = self.nodes[0].get_wallet_rpc("large")
917917
outputs = {}
918918
rawtx = recipient.createrawtransaction([], {wallet.getnewaddress(): 147.99899260})
919919

920-
# Make 1500 0.1 BTC outputs
921-
# The amount that we target for funding is in the BnB range when these outputs are used.
922-
# However if these outputs are selected, the transaction will end up being too large, so it shouldn't use BnB and instead fallback to Knapsack
923-
# but that behavior is not implemented yet. For now we just check that we get an error.
924-
for i in range(0, 1500):
920+
# Make 1500 0.1 BTC outputs. The amount that we target for funding is in
921+
# the BnB range when these outputs are used. However if these outputs
922+
# are selected, the transaction will end up being too large, so it
923+
# shouldn't use BnB and instead fall back to Knapsack but that behavior
924+
# is not implemented yet. For now we just check that we get an error.
925+
for _ in range(1500):
925926
outputs[recipient.getnewaddress()] = 0.1
926927
wallet.sendmany("", outputs)
927928
self.nodes[0].generate(10)
928929
assert_raises_rpc_error(-4, "Transaction too large", recipient.fundrawtransaction, rawtx)
929930

931+
930932
if __name__ == '__main__':
931933
RawTransactionsTest().main()

0 commit comments

Comments
 (0)