This case invokes bitcoin-cli via raw subprocess.run() without -datadir, so it reads the default datadir's bitcoin.conf (e.g. ~/.bitcoin) and fails whenever that real config is unusable. Pass the node's -datadir so the check reads the test's own bitcoin.conf and depends only on the build's IPC support, not the host environment.
test: pass -datadir to bitcoin-cli -ipcconnect check #35431
pull mjdietzx wants to merge 1 commits into bitcoin:master from mjdietzx:minor_fix_interface_bitcoin_cli_test changing 1 files +2 −1-
mjdietzx commented at 1:17 PM on June 1, 2026: contributor
- DrahtBot added the label Tests on Jun 1, 2026
-
DrahtBot commented at 1:17 PM on June 1, 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/35431.
<!--021abf342d371248e50ceaed478a90ca-->
Reviews
See the guideline for information on the review process.
If your review is incorrectly listed, please copy-paste <code><!--meta-tag:bot-skip--></code> into the comment that the bot should ignore.
<!--5faf32d7da4f0f540f40219e4f7537a3-->
-
fanquake commented at 1:18 PM on June 1, 2026: member
cc @ryanofsky @Sjors
-
in test/functional/interface_bitcoin_cli.py:463 in a3d8efa213
457 | @@ -458,7 +458,9 @@ def run_test(self): 458 | # This tests behavior when ENABLE_IPC is off. When it is on, 459 | # behavior is checked by the interface_ipc_cli.py test. 460 | self.log.info("Test bitcoin-cli -ipcconnect triggers error if not built with IPC support") 461 | - args = [self.binary_paths.bitcoincli, "-ipcconnect=unix", "-getinfo"] 462 | + # Pass the node's -datadir so bitcoin-cli reads the test's bitcoin.conf rather than a 463 | + # real one in the default datadir (e.g. ~/.bitcoin), keeping this test self-contained. 464 | + args = [self.binary_paths.bitcoincli, f"-datadir={self.nodes[0].datadir_path}", "-ipcconnect=unix", "-getinfo"]
maflcko commented at 10:47 AM on June 2, 2026:Why is this not using valgrind?
$ git grep -A1 Binaries::node_argv test/ test/functional/tool_bitcoin.py: # Manually construct the `bitcoin node` command, similar to Binaries::node_argv() test/functional/tool_bitcoin.py- bitcoin_cmd = node.binaries.valgrind_cmd + [node.binaries.paths.bitcoin_bin]Also, the options (datadir, etc ) would better come from
self.nodes[0].cli.options?
maflcko commented at 3:07 PM on June 2, 2026:Ah, I see. Of course rpcconnect and ipcconnect are mutually exclusive. I wonder if it could make sense to remove
--usecliand instead add--usecli-rpcand--usecli-ipc, which then sets either-rpcconnector-ipconnectin a later pull request?mjdietzx force-pushed on Jun 2, 20267735c13488test: run bitcoin-cli -ipcconnect check under valgrind with -datadir
This case invoked bitcoin-cli via raw subprocess.run() without the valgrind wrapper (bypassing valgrind) and without -datadir (so it read the default datadir's bitcoin.conf, e.g. ~/.bitcoin, and failed whenever that real config was unusable). Build the command like the rest of the framework: prepend binaries.valgrind_cmd and pass the node's -datadir so the check runs under valgrind and depends only on the build's IPC support, not the host environment.
mjdietzx force-pushed on Jun 2, 2026maflcko commented at 3:05 PM on June 2, 2026: memberlgtm ACK 7735c134887c9ab25d4ec3dc1981b5e4ae4b3ece
sedited approvedsedited commented at 8:58 AM on June 4, 2026: contributorACK 7735c134887c9ab25d4ec3dc1981b5e4ae4b3ece
sedited merged this on Jun 4, 2026sedited closed this on Jun 4, 2026
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-06-11 10:51 UTC
More mirrored repositories can be found on mirror.b10c.me