test/functional/rpc_fundrawtransaction.py is fairly slow to run and has no logging, so it can appear to be stalled.
This commit adds info logging at each test to provide feedback on the test run.
test/functional/rpc_fundrawtransaction.py is fairly slow to run and has no logging, so it can appear to be stalled.
This commit adds info logging at each test to provide feedback on the test run.
Motivation: Watching @achow101 swear repeatedly at this test yesterday :)
Test output with this commit:
$ test/functional/rpc_fundrawtransaction.py
2019-10-31T10:54:24.851000Z TestFramework (INFO): Initializing test directory /tmp/bitcoin_func_test_qrx99bxz
2019-10-31T10:54:25.790000Z TestFramework (INFO): Setup, generating 126 nodes and syncing...
2019-10-31T10:54:28.704000Z TestFramework (INFO): Testing fundrawtxn changePosition option
2019-10-31T10:54:29.393000Z TestFramework (INFO): Testing fundrawtxn
2019-10-31T10:54:29.442000Z TestFramework (INFO): Testing fundrawtxn with 2 coins
2019-10-31T10:54:29.559000Z TestFramework (INFO): Testing fundrawtxn with 2 outputs
2019-10-31T10:54:29.670000Z TestFramework (INFO): Testing fundrawtxn with a vin > required amount
2019-10-31T10:54:29.743000Z TestFramework (INFO): Testing fundrawtxn not having a change output
2019-10-31T10:54:29.821000Z TestFramework (INFO): Testing fundrawtxn with an invalid option
2019-10-31T10:54:29.859000Z TestFramework (INFO): Testing fundrawtxn with an invalid change address
2019-10-31T10:54:29.901000Z TestFramework (INFO): Testing fundrawtxn with a provided change address
2019-10-31T10:54:29.971000Z TestFramework (INFO): Testing fundrawtxn with a provided change type
2019-10-31T10:54:30.043000Z TestFramework (INFO): Testing fundrawtxn with a vin < required amount
2019-10-31T10:54:30.124000Z TestFramework (INFO): Testing fundrawtxn with 2 vins
2019-10-31T10:54:30.202000Z TestFramework (INFO): Testing fundrawtxn with 2 vins and 2 vouts
2019-10-31T10:54:30.353000Z TestFramework (INFO): Testing fundrawtxn with an invalid vin
2019-10-31T10:54:30.412000Z TestFramework (INFO): Testing fundrawtxn p2pkh fee
2019-10-31T10:54:30.605000Z TestFramework (INFO): Testing fundrawtxn p2pkh fee with multiple outputs
2019-10-31T10:54:31.091000Z TestFramework (INFO): Testing fundrawtxn fee with 4of5 addresses
2019-10-31T10:54:31.313000Z TestFramework (INFO): Testing fundrawtxn spending 2of2 multisig...
2019-10-31T10:54:41.876000Z TestFramework (INFO): Testing fundrawtxn with locked wallet...
2019-10-31T10:54:45.003000Z TestFramework (INFO): Testing fundrawtxn fee with many inputs...
2019-10-31T10:54:54.834000Z TestFramework (INFO): Testing fundrawtxn sign+send with many inputs...
2019-10-31T10:55:18.605000Z TestFramework (INFO): Testing fundrawtxn with OP_RETURN and no vin
2019-10-31T10:55:18.635000Z TestFramework (INFO): Testing fundrawtxn using only watchonly
2019-10-31T10:55:18.785000Z TestFramework (INFO): Testing fundrawtxn using entirety of watched funds
2019-10-31T10:55:18.941000Z TestFramework (INFO): Testing fundrawtxn feeRate option
2019-10-31T10:55:19.390000Z TestFramework (INFO): Testing fundrawtxn no address reuse occurs
2019-10-31T10:55:19.551000Z TestFramework (INFO): Testing fundrawtxn subtractFeeFromOutputs option
2019-10-31T10:55:20.174000Z TestFramework (INFO): Stopping nodes
2019-10-31T10:55:20.429000Z TestFramework (INFO): Cleaning up /tmp/bitcoin_func_test_qrx99bxz on exit
2019-10-31T10:55:20.429000Z TestFramework (INFO): Tests successful
Slower-running tests are those suffixed with ...
since you're touching so many lines, maybe just take the ASCII art headers and turn the actual text into the print line? sorry :grimacing:
317 | @@ -305,6 +318,7 @@ def test_two_vin(self):
318 | ###########################################
319 | # test a fundrawtransaction with two VINs #
f.e. just convert this line into a print statement
Jup, can remove this now
Done, ASCII art blocks removed.
40 | @@ -41,6 +41,7 @@ def setup_network(self): 41 | connect_nodes(self.nodes[0], 3) 42 | 43 | def run_test(self): 44 | + self.log.info("Setup, generating 126 nodes and syncing...")
Do you mean 126 blocks? Also, I think there are only 122. Perhaps best to just omit the number?
498 | @@ -464,6 +499,7 @@ def test_fee_4of5(self): 499 | def test_spend_2of2(self): 500 | ############################################################ 501 | # spend a 2of2 multisig transaction over fundraw 502 | + self.log.info("Testing fundrawtxn spending 2of2 multisig...")
nit: prefer 2-of-2
Done, did the same for "4of5"
738 | @@ -695,6 +739,7 @@ def test_address_reuse(self): 739 | ################################ 740 | # Test no address reuse occurs # 741 | ################################ 742 | + self.log.info("Testing fundrawtxn no address reuse occurs")
this sentence sounds a bit clunky. Perhaps "Test no address reuse occurs with fundrawransaction"
Agree, replacing with "Test fundrawtxn does not reuse addresses" to maintain consistent verb + op noun logging sentences.
Thanks for doing this. A few personal style nits:
test/functional/rpc_fundrawtransaction.py is fairly long to run and has no
logging, so it can appear to be stalled.
This commit adds info logging at each test to provide feedback on the test run.
Doc changes only to test/functional/rpc_fundrawtransaction.py:
- remove ascii art or convert to a docstring when sufficiently different from
the logging
- touch up other comments while here
Thank you @instagibbs, @MarcoFalke, and @jnewbery for reviewing, updated with your suggestions.
Test output after updates:
$ test/functional/rpc_fundrawtransaction.py
2019-11-01T10:58:43.324000Z TestFramework (INFO): Initializing test directory /tmp/bitcoin_func_test_vh0ej7_v
2019-11-01T10:58:44.504000Z TestFramework (INFO): Connect nodes, set fees, generate blocks, and sync
2019-11-01T10:58:46.250000Z TestFramework (INFO): Test fundrawtxn changePosition option
2019-11-01T10:58:47.847000Z TestFramework (INFO): Test fundrawtxn
2019-11-01T10:58:47.950000Z TestFramework (INFO): Test fundrawtxn with 2 coins
2019-11-01T10:58:48.025000Z TestFramework (INFO): Test fundrawtxn with 2 outputs
2019-11-01T10:58:48.093000Z TestFramework (INFO): Test fundrawtxn with a vin > required amount
2019-11-01T10:58:48.150000Z TestFramework (INFO): Test fundrawtxn not having a change output
2019-11-01T10:58:48.209000Z TestFramework (INFO): Test fundrawtxn with an invalid option
2019-11-01T10:58:48.241000Z TestFramework (INFO): Test fundrawtxn with an invalid change address
2019-11-01T10:58:48.274000Z TestFramework (INFO): Test fundrawtxn with a provided change address
2019-11-01T10:58:48.331000Z TestFramework (INFO): Test fundrawtxn with a provided change type
2019-11-01T10:58:48.382000Z TestFramework (INFO): Test fundrawtxn with a vin < required amount
2019-11-01T10:58:48.493000Z TestFramework (INFO): Test fundrawtxn with 2 vins
2019-11-01T10:58:48.645000Z TestFramework (INFO): Test fundrawtxn with 2 vins and 2 vouts
2019-11-01T10:58:48.804000Z TestFramework (INFO): Test fundrawtxn with an invalid vin
2019-11-01T10:58:48.889000Z TestFramework (INFO): Test fundrawtxn p2pkh fee
2019-11-01T10:58:49.005000Z TestFramework (INFO): Test fundrawtxn p2pkh fee with multiple outputs
2019-11-01T10:58:49.540000Z TestFramework (INFO): Test fundrawtxn fee with 4-of-5 addresses
2019-11-01T10:58:49.775000Z TestFramework (INFO): Test fundrawtxn spending 2-of-2 multisig
2019-11-01T10:59:03.159000Z TestFramework (INFO): Test fundrawtxn with locked wallet
2019-11-01T10:59:06.770000Z TestFramework (INFO): Test fundrawtxn fee with many inputs
2019-11-01T10:59:20.289000Z TestFramework (INFO): Test fundrawtxn sign+send with many inputs
2019-11-01T10:59:38.379000Z TestFramework (INFO): Test fundrawtxn with OP_RETURN and no vin
2019-11-01T10:59:38.415000Z TestFramework (INFO): Test fundrawtxn using only watchonly
2019-11-01T10:59:38.614000Z TestFramework (INFO): Test fundrawtxn using entirety of watched funds
2019-11-01T10:59:38.769000Z TestFramework (INFO): Test fundrawtxn feeRate option
2019-11-01T10:59:39.215000Z TestFramework (INFO): Test fundrawtxn does not reuse addresses
2019-11-01T10:59:39.382000Z TestFramework (INFO): Test fundrawtxn subtractFeeFromOutputs option
2019-11-01T10:59:40.115000Z TestFramework (INFO): Stopping nodes
2019-11-01T10:59:40.385000Z TestFramework (INFO): Cleaning up /tmp/bitcoin_func_test_vh0ej7_v on exit
2019-11-01T10:59:40.385000Z TestFramework (INFO): Tests successful
tACK ff22751417c6fbbd22f4eefd0e23431a83335c13