test: Allow --usecli in more tests #35334

pull maflcko wants to merge 7 commits into bitcoin:master from maflcko:2605-test-more-use-cli changing 7 files +59 −80
  1. maflcko commented at 2:22 PM on May 20, 2026: member

    Some tests disallow to be run under --usecli. This reduces the coverage and risks that bugs in the bitcoin-cli go unnoticed.

    The commits should be self-explanatory and can be reviewed and tested one-by-one.

  2. test: [move-only] Extract create_new_rpc_connection
    Re-using the same rpc connection on multiple threads is obviously
    unsafe, so this helper can be used to create one connection per thread.
    
    This refactor does not change any behavior and can be reviewed with the
    git options:
    
    --color-moved=dimmed-zebra --color-moved-ws=ignore-all-space
    fa37c6a529
  3. DrahtBot added the label Tests on May 20, 2026
  4. DrahtBot commented at 2:22 PM on May 20, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/35334.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK willcl-ark
    Concept ACK fanquake

    If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #35049 (test: remove circular dependency between authproxy and util by rkrux)
    • #34927 (test: Check that RPCs do not time out, even under load by maflcko)
    • #34566 (feature: Use different datadirs for different signets by ekzyis)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  5. maflcko force-pushed on May 20, 2026
  6. DrahtBot added the label CI failed on May 20, 2026
  7. maflcko force-pushed on May 21, 2026
  8. DrahtBot removed the label CI failed on May 21, 2026
  9. maflcko force-pushed on May 21, 2026
  10. fanquake commented at 9:26 AM on May 21, 2026: member

    Concept ACK

  11. in test/functional/test_framework/test_node.py:307 in fa67927b98
     303 | @@ -301,16 +304,23 @@ def start(self, extra_args=None, *, cwd=None, stdout=None, stderr=None, env=None
     304 |          if self.start_perf:
     305 |              self._start_perf()
     306 |  
     307 | -    def create_new_rpc_connection(self):
     308 | +    def create_new_rpc_connection(self, *, typ="AUTO", client_timeout=None):
    


    willcl-ark commented at 8:23 PM on May 21, 2026:

    just personal preference but typ looks like a typo to me (even though I know it's to avoid shadowing the builtin). If you retouch (and agree) could perhaps consider mode or backend or something :)


    maflcko commented at 6:31 AM on May 22, 2026:

    Obviously, it was German, but I changed to mode :)

  12. willcl-ark approved
  13. willcl-ark commented at 8:29 PM on May 21, 2026: member

    ACK fa732f0aacfae28ca6b23d9759f22f592528ad3b

    Nice coverage improvement.

    I agree that centralizing new per-thread/per-call RPC creation in create_new_rpc_connection() also makes things clearer overall.

  14. DrahtBot requested review from fanquake on May 21, 2026
  15. test: Allow mining_getblocktemplate_longpoll.py --usecli
    Part of the diff can be reviewed with --ignore-all-space
    fa2a3683d5
  16. test: Allow feature_shutdown.py --usecli fa3ae6c7d3
  17. refactor: Use create_new_rpc_connection in wallet_multiwallet.py fa8f25118c
  18. test: Allow rpc_bind.py --usecli
    This allows to run the test under bitcoin-cli, except for one small
    part, which is skipped for now.
    
    This also inlines rpc_url directly into create_new_rpc_connection,
    because this is the only place where it is needed.
    fa00c7c7a4
  19. refactor: Inline get_rpc_proxy
    This is only used and needed in a single place.
    fae376cafb
  20. maflcko force-pushed on May 22, 2026
  21. refactor: Set TestNode.cli only after RPC is connected
    The cli can only be called after the RPC is connected, so the cli field
    should only be set after that. This is similar to the _rpc field.
    
    This change has also other benefits:
    
    * Manually overwriting the cli with a new rpchost is no longer needed,
      so one cli-specific line can be removed from the rpc_bind.py test.
    * The datadir and rpc_timeout fields are removed from the TestNodeCLI
      struct. They were redundant with the -datadir and -rpcclienttimeout
      command line options. Any command line option can be overwritten by
      appending it with a new value, if needed.
    faf02674b3
  22. maflcko force-pushed on May 22, 2026
  23. DrahtBot added the label CI failed on May 22, 2026
  24. DrahtBot removed the label CI failed on May 22, 2026
  25. willcl-ark approved
  26. willcl-ark commented at 8:41 AM on May 22, 2026: member

    reACK faf02674b3623c3cbaa2aec0ab02b5859d19b022

    Only change was typ renamed to mode.

  27. fanquake merged this on May 22, 2026
  28. fanquake closed this on May 22, 2026

  29. maflcko deleted the branch on May 22, 2026


fanquake

Labels

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-05-22 20:51 UTC

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