test: add rpc_fundrawtransaction logging #17327

pull jonatack wants to merge 2 commits into bitcoin:master from jonatack:rpc_fundrawtransaction-test-logging changing 1 files +104 −123
  1. jonatack commented at 10:57 AM on October 31, 2019: member

    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.

  2. jonatack commented at 10:59 AM on October 31, 2019: member

    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 ...

  3. fanquake added the label Tests on Oct 31, 2019
  4. instagibbs commented at 3:04 PM on October 31, 2019: member

    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:

  5. in test/functional/rpc_fundrawtransaction.py:319 in 1760e74e29 outdated
     317 | @@ -305,6 +318,7 @@ def test_two_vin(self):
     318 |          ###########################################
     319 |          # test a fundrawtransaction with two VINs #
    


    instagibbs commented at 3:05 PM on October 31, 2019:

    f.e. just convert this line into a print statement


    MarcoFalke commented at 3:45 PM on October 31, 2019:

    Jup, can remove this now


    jonatack commented at 10:14 AM on November 1, 2019:

    Done, ASCII art blocks removed.

  6. in test/functional/rpc_fundrawtransaction.py:44 in 1760e74e29 outdated
      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...")
    


    jnewbery commented at 4:10 PM on October 31, 2019:

    Do you mean 126 blocks? Also, I think there are only 122. Perhaps best to just omit the number?


    jonatack commented at 10:14 AM on November 1, 2019:

    Thanks @jnewbery! 4 nodes and 122 blocks. Replacing with "Connect nodes, set fees, generate blocks, and sync"

  7. in test/functional/rpc_fundrawtransaction.py:502 in 1760e74e29 outdated
     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...")
    


    jnewbery commented at 4:14 PM on October 31, 2019:

    nit: prefer 2-of-2


    jonatack commented at 10:15 AM on November 1, 2019:

    Done, did the same for "4of5"

  8. in test/functional/rpc_fundrawtransaction.py:742 in 1760e74e29 outdated
     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")
    


    jnewbery commented at 4:15 PM on October 31, 2019:

    this sentence sounds a bit clunky. Perhaps "Test no address reuse occurs with fundrawransaction"


    jonatack commented at 10:17 AM on November 1, 2019:

    Agree, replacing with "Test fundrawtxn does not reuse addresses" to maintain consistent verb + op noun logging sentences.

  9. jnewbery commented at 4:17 PM on October 31, 2019: member

    Thanks for doing this. A few personal style nits:

    • I think the indicative would sound better in these test logs (eg "test x" rather than "testing x")
    • agree with the other reviewers that the logs can replace the comment blocks
    • I'd prefer to remove the trailing '...' ellipses. It's not standard that they mean "this takes a long time"
  10. test: add rpc_fundrawtransaction logging
    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.
    94fcc08541
  11. laanwj commented at 10:56 AM on November 1, 2019: member

    Concept ACK, agree with @jnewbery's nits.

  12. test: rm ascii art in rpc_fundrawtransaction
    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
    ff22751417
  13. jonatack force-pushed on Nov 1, 2019
  14. jonatack commented at 10:57 AM on November 1, 2019: member

    Thank you @instagibbs, @MarcoFalke, and @jnewbery for reviewing, updated with your suggestions.

  15. jonatack commented at 11:00 AM on November 1, 2019: member

    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
    
  16. jnewbery commented at 2:20 PM on November 1, 2019: member

    tACK ff22751417c6fbbd22f4eefd0e23431a83335c13

  17. MarcoFalke referenced this in commit bc3fcf3c0d on Nov 1, 2019
  18. MarcoFalke merged this on Nov 1, 2019
  19. MarcoFalke closed this on Nov 1, 2019

  20. jonatack deleted the branch on Nov 1, 2019
  21. sidhujag referenced this in commit 1190346105 on Nov 2, 2019
  22. sidhujag referenced this in commit d8185936c0 on Nov 10, 2020
  23. DrahtBot locked this on Dec 16, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-14 21:14 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me