test: less ambiguous error if bitcoind is missing #32921

pull Sjors wants to merge 1 commits into bitcoin:master from Sjors:2025/07/test-missing-binary changing 1 files +17 −12
  1. Sjors commented at 8:37 am on July 8, 2025: member

    Before this change, when a functional test is run without building the source, the error message suggested that previous release binaries were missing.

    When no previous release version is set, make the error message more specifically about bitcoind.

    To test, try this before and after:

    0git clean -dfx
    1cmake -B build
    2build/test/functional/mining_basic.py
    3cmake --build build
    4build/test/functional/mining_basic.py
    5build/test/functional/wallet_backwards_compatibility.py
    6test/get_previous_releases.py
    7build/test/functional/wallet_backwards_compatibility.py
    
  2. DrahtBot added the label Tests on Jul 8, 2025
  3. DrahtBot commented at 8:37 am on July 8, 2025: contributor

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

    Code Coverage & Benchmarks

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

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK janb84, w0xlt, achow101

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

    LLM Linter (✨ experimental)

    Possible typos and grammar issues:

    • “Previous releases binaries” -> “Previous release binaries” [fix plural noun for clarity]

    drahtbot_id_4_m

  4. Sjors force-pushed on Jul 8, 2025
  5. DrahtBot added the label CI failed on Jul 8, 2025
  6. DrahtBot commented at 8:46 am on July 8, 2025: contributor

    🚧 At least one of the CI tasks failed. Task lint: https://github.com/bitcoin/bitcoin/runs/45539391667 LLM reason (✨ experimental): Lint errors caused the CI failure.

    Try to run the tests locally, according to the documentation. However, a CI failure may still happen due to a number of reasons, for example:

    • Possibly due to a silent merge conflict (the changes in this pull request being incompatible with the current code in the target branch). If so, make sure to rebase on the latest commit of the target branch.

    • A sanitizer issue, which can only be found by compiling with the sanitizer and running the affected test.

    • An intermittent issue.

    Leave a comment here, if you need help tracking down a confusing failure.

  7. in test/functional/test_framework/test_framework.py:559 in 93c703d2ce outdated
    566+                                     for argv in (binaries.node_argv(), binaries.rpc_argv())):
    567+
    568+                if shutil.which(bin_path) is None:
    569+                    self.log.error(f"Binary not found: {bin_path}")
    570+                    if v is None:
    571+                        raise AssertionError("bitcoind is missing, did you compile?")
    


    maflcko commented at 9:39 am on July 8, 2025:
    0                        raise AssertionError("At least one binary is missing, did you compile?")
    

    there are more binaries that could be missing, than just bitcoind?


    Sjors commented at 11:20 am on July 8, 2025:
    Done
  8. DrahtBot removed the label CI failed on Jul 8, 2025
  9. test: less ambiguous error if bitcoind is missing
    Before this change, when a functional test is run without building
    the source, the error message suggested that previous release binaries
    were missing.
    
    When no previous release version is set, make the error message more
    specifically about bitcoind.
    83bb414557
  10. Sjors force-pushed on Jul 8, 2025
  11. Sjors commented at 11:20 am on July 8, 2025: member
    If you’re testing this on Apple Silicon, you may also need #32922.
  12. janb84 commented at 6:26 pm on July 8, 2025: contributor

    ACK 83bb41455715a9e05320ba791987204031626c10

    PR changes error when no binaries are found that are necessary for the functional test(s). Old error gave the impression that previous binaries needed to be downloaded, new error (only) correctly state that the binaries are missing and gives an hint that one forgot to compile. This more correct and I agree with the change.

    • code review ✅
    • tested on Apple Silicon without #32922 (nix shell)

    Master:

     0$ build/test/functional/mining_basic.py
     12025-07-08T18:13:40.455522Z TestFramework (INFO): PRNG seed is: 8663704818878322585
     22025-07-08T18:13:40.455980Z TestFramework (INFO): Initializing test directory /private/tmp/nix-shell-56840-0/bitcoin_func_test_ntyajsde
     32025-07-08T18:13:40.456786Z TestFramework (ERROR): Binary not found: /Users/jan/Projects/bitcoin/build/bin/bitcoind
     42025-07-08T18:13:40.456840Z TestFramework (ERROR): Binary not found: /Users/jan/Projects/bitcoin/build/bin/bitcoin-cli
     52025-07-08T18:13:40.456885Z TestFramework (ERROR): Binary not found: /Users/jan/Projects/bitcoin/build/bin/bitcoind
     62025-07-08T18:13:40.456916Z TestFramework (ERROR): Binary not found: /Users/jan/Projects/bitcoin/build/bin/bitcoin-cli
     72025-07-08T18:13:40.456955Z TestFramework (ERROR): Binary not found: /Users/jan/Projects/bitcoin/build/bin/bitcoind
     82025-07-08T18:13:40.456990Z TestFramework (ERROR): Binary not found: /Users/jan/Projects/bitcoin/build/bin/bitcoin-cli
     92025-07-08T18:13:40.457022Z TestFramework (ERROR): Assertion failed
    10Traceback (most recent call last):
    11  File "/Users/jan/Projects/bitcoin/test/functional/test_framework/test_framework.py", line 191, in main
    12    self.setup()
    13  File "/Users/jan/Projects/bitcoin/test/functional/test_framework/test_framework.py", line 361, in setup
    14    self.setup_network()
    15  File "/Users/jan/Projects/bitcoin/test/functional/test_framework/test_framework.py", line 452, in setup_network
    16    self.setup_nodes()
    17  File "/Users/jan/Projects/bitcoin/test/functional/test_framework/test_framework.py", line 473, in setup_nodes
    18    self.add_nodes(self.num_nodes, self.extra_args)
    19  File "/Users/jan/Projects/bitcoin/test/functional/test_framework/test_framework.py", line 558, in add_nodes
    20    raise AssertionError("At least one release binary is missing. "
    21AssertionError: At least one release binary is missing. Previous releases binaries can be downloaded via `test/get_previous_releases.py`.
    222025-07-08T18:13:40.512675Z TestFramework (INFO): Not stopping nodes as test failed. The dangling processes will be cleaned up later.
    232025-07-08T18:13:40.512797Z TestFramework (WARNING): Not cleaning up dir /private/tmp/nix-shell-56840-0/bitcoin_func_test_ntyajsde
    242025-07-08T18:13:40.512841Z TestFramework (ERROR): Test failed. Test logging available at /private/tmp/nix-shell-56840-0/bitcoin_func_test_ntyajsde/test_framework.log
    252025-07-08T18:13:40.512911Z TestFramework (ERROR):
    262025-07-08T18:13:40.513025Z TestFramework (ERROR): Hint: Call /Users/jan/Projects/bitcoin/test/functional/combine_logs.py '/private/tmp/nix-shell-56840-0/bitcoin_func_test_ntyajsde' to consolidate all logs
    272025-07-08T18:13:40.513062Z TestFramework (ERROR):
    282025-07-08T18:13:40.513093Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
    292025-07-08T18:13:40.513139Z TestFramework (ERROR): https://github.com/bitcoin/bitcoin/issues
    302025-07-08T18:13:40.513171Z TestFramework (ERROR):
    

    This PR (error)

     0$ build/test/functional/mining_basic.py
     12025-07-08T18:08:39.622104Z TestFramework (INFO): PRNG seed is: 7569875464969361775
     22025-07-08T18:08:39.622584Z TestFramework (INFO): Initializing test directory /private/tmp/nix-shell-56840-0/bitcoin_func_test_6xo20r7u
     32025-07-08T18:08:39.623408Z TestFramework (ERROR): Binary not found: /Users/jan/Projects/bitcoin/build/bin/bitcoind
     42025-07-08T18:08:39.623454Z TestFramework (ERROR): Assertion failed
     5Traceback (most recent call last):
     6  File "/Users/jan/Projects/bitcoin/test/functional/test_framework/test_framework.py", line 191, in main
     7    self.setup()
     8  File "/Users/jan/Projects/bitcoin/test/functional/test_framework/test_framework.py", line 361, in setup
     9    self.setup_network()
    10  File "/Users/jan/Projects/bitcoin/test/functional/test_framework/test_framework.py", line 452, in setup_network
    11    self.setup_nodes()
    12  File "/Users/jan/Projects/bitcoin/test/functional/test_framework/test_framework.py", line 473, in setup_nodes
    13    self.add_nodes(self.num_nodes, self.extra_args)
    14  File "/Users/jan/Projects/bitcoin/test/functional/test_framework/test_framework.py", line 559, in add_nodes
    15    raise AssertionError("At least one binary is missing, did you compile?")
    16AssertionError: At least one binary is missing, did you compile?
    172025-07-08T18:08:39.679097Z TestFramework (INFO): Not stopping nodes as test failed. The dangling processes will be cleaned up later.
    182025-07-08T18:08:39.679159Z TestFramework (WARNING): Not cleaning up dir /private/tmp/nix-shell-56840-0/bitcoin_func_test_6xo20r7u
    192025-07-08T18:08:39.679197Z TestFramework (ERROR): Test failed. Test logging available at /private/tmp/nix-shell-56840-0/bitcoin_func_test_6xo20r7u/test_framework.log
    202025-07-08T18:08:39.679258Z TestFramework (ERROR):
    212025-07-08T18:08:39.679362Z TestFramework (ERROR): Hint: Call /Users/jan/Projects/bitcoin/test/functional/combine_logs.py '/private/tmp/nix-shell-56840-0/bitcoin_func_test_6xo20r7u' to consolidate all logs
    222025-07-08T18:08:39.679396Z TestFramework (ERROR):
    232025-07-08T18:08:39.679427Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
    242025-07-08T18:08:39.679470Z TestFramework (ERROR): https://github.com/bitcoin/bitcoin/issues
    252025-07-08T18:08:39.679500Z TestFramework (ERROR):
    

    This PR (after compile)

    0$ build/test/functional/mining_basic.py
    12025-07-08T18:10:51.573960Z TestFramework (INFO): PRNG seed is: 3664027831089907027
    22025-07-08T18:10:51.574415Z TestFramework (INFO): Initializing test directory /private/tmp/nix-shell-56840-0/bitcoin_func_test_hmt823xs
    32025-07-08T18:10:52.358905Z TestFramework (INFO): Create some old blocks
    4[...]
    52025-07-08T18:11:10.301402Z TestFramework (INFO): Sanity check generated blocks have their coinbase timelocked to their height.
    62025-07-08T18:11:10.357987Z TestFramework (INFO): Stopping nodes
    72025-07-08T18:11:10.524961Z TestFramework (INFO): Cleaning up /private/tmp/nix-shell-56840-0/bitcoin_func_test_hmt823xs on exit
    82025-07-08T18:11:10.525039Z TestFramework (INFO): Tests successful
    
  13. achow101 commented at 9:45 pm on July 10, 2025: member
    ACK 83bb41455715a9e05320ba791987204031626c10
  14. achow101 merged this on Jul 10, 2025
  15. achow101 closed this on Jul 10, 2025


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: 2025-07-11 09:13 UTC

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