Bitcoin Core mirror and no, I don't give a fuck about Monero.
Find a file
Ava Chow 56725f8829
Merge bitcoin/bitcoin#31462: test: raise explicit error if any of the needed release binaries is missing
1ea7e45a1f test: raise explicit error if any of the needed release binaries is missing (Sebastian Falbesoner)

Pull request description:

  If the `releases` directory exists, but still only a subset of the necessary previous release binaries are available, the test fails by throwing an exception (sometimes leading to follow-up exceptions like `AssertionError: [node 0] Error: no RPC connection`) and printing out a stack trace, which can be confusing and at a first glance suggests that the node crashed or some alike.
  Improve this by checking and printing out *all* of the missing release binaries and failing with an explicit error in this case. Also add an info on how to download previous releases binaries. Noticed while testing #30328.

  Can be tested by e.g.

  ```
  $ rm -rf ./releases
  $ ./test/get_previous_releases.py -b
  $ rm -rf ./releases/v28.0/
  $ ./build/test/functional/wallet_migration.py
  ```

  master:
  <details>
  <summary>Long test fail output</summary>

  ```
  ...
  2024-12-10T18:48:54.067000Z TestFramework (ERROR): Assertion failed
  Traceback (most recent call last):
    File "/home/thestack/bitcoin/test/functional/test_framework/test_framework.py", line 590, in start_nodes
      node.start(extra_args[i], *args, **kwargs)
    File "/home/thestack/bitcoin/test/functional/test_framework/test_node.py", line 257, in start
      self.process = subprocess.Popen(self.args + extra_args, env=subp_env, stdout=stdout, stderr=stderr, cwd=cwd, **kwargs)
    File "/usr/lib/python3.10/subprocess.py", line 971, in __init__
      self._execute_child(args, executable, preexec_fn, close_fds,
    File "/usr/lib/python3.10/subprocess.py", line 1863, in _execute_child
      raise child_exception_type(errno_num, err_msg, err_filename)
  FileNotFoundError: [Errno 2] No such file or directory: '/home/thestack/bitcoin/releases/v28.0/bin/bitcoind'

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "/home/thestack/bitcoin/test/functional/test_framework/test_framework.py", line 131, in main
      self.setup()
    File "/home/thestack/bitcoin/test/functional/test_framework/test_framework.py", line 315, in setup
      self.setup_network()
    File "/home/thestack/bitcoin/test/functional/test_framework/test_framework.py", line 409, in setup_network
      self.setup_nodes()
    File "/home/thestack/bitcoin/./build/test/functional/wallet_migration.py", line 54, in setup_nodes
      self.start_nodes()
    File "/home/thestack/bitcoin/test/functional/test_framework/test_framework.py", line 595, in start_nodes
      self.stop_nodes()
    File "/home/thestack/bitcoin/test/functional/test_framework/test_framework.py", line 610, in stop_nodes
      node.stop_node(wait=wait, wait_until_stopped=False)
    File "/home/thestack/bitcoin/test/functional/test_framework/test_node.py", line 396, in stop_node
      self.stop(wait=wait)
    File "/home/thestack/bitcoin/test/functional/test_framework/test_node.py", line 215, in __getattr__
      assert self.rpc_connected and self.rpc is not None, self._node_msg("Error: no RPC connection")
  AssertionError: [node 0] Error: no RPC connection
  2024-12-10T18:48:54.118000Z TestFramework (INFO): Stopping nodes
  Traceback (most recent call last):
    File "/home/thestack/bitcoin/./build/test/functional/wallet_migration.py", line 1097, in <module>
      WalletMigrationTest(__file__).main()
    File "/home/thestack/bitcoin/test/functional/test_framework/test_framework.py", line 159, in main
      exit_code = self.shutdown()
    File "/home/thestack/bitcoin/test/functional/test_framework/test_framework.py", line 331, in shutdown
      self.stop_nodes()
    File "/home/thestack/bitcoin/test/functional/test_framework/test_framework.py", line 610, in stop_nodes
      node.stop_node(wait=wait, wait_until_stopped=False)
    File "/home/thestack/bitcoin/test/functional/test_framework/test_node.py", line 396, in stop_node
      self.stop(wait=wait)
    File "/home/thestack/bitcoin/test/functional/test_framework/test_node.py", line 215, in __getattr__
      assert self.rpc_connected and self.rpc is not None, self._node_msg("Error: no RPC connection")
  AssertionError: [node 0] Error: no RPC connection
  [node 0] Cleaning up leftover process
  ...
  ```
  </details>

  PR:
  ```
  ...
  2025-01-01T20:26:27.999000Z TestFramework (INFO): PRNG seed is: 4570383538468804512
  2025-01-01T20:26:28.000000Z TestFramework (INFO): Initializing test directory /tmp/bitcoin_func_test_lz66_zcu
  2025-01-01T20:26:28.003000Z TestFramework (ERROR): Binary not found: /home/thestack/bitcoin/releases/v28.0/bin/bitcoind
  2025-01-01T20:26:28.003000Z TestFramework (ERROR): Binary not found: /home/thestack/bitcoin/releases/v28.0/bin/bitcoin-cli
  2025-01-01T20:26:28.003000Z TestFramework (INFO): Previous releases binaries can be downloaded via `test/get_previous_releases.py -b`.
  2025-01-01T20:26:28.003000Z TestFramework (ERROR): Assertion failed
  Traceback (most recent call last):
    File "/home/thestack/bitcoin/test/functional/test_framework/test_framework.py", line 131, in main
      self.setup()
    File "/home/thestack/bitcoin/test/functional/test_framework/test_framework.py", line 315, in setup
      self.setup_network()
    File "/home/thestack/bitcoin/test/functional/test_framework/test_framework.py", line 409, in setup_network
      self.setup_nodes()
    File "/home/thestack/bitcoin/./build/test/functional/wallet_migration.py", line 50, in setup_nodes
      self.add_nodes(self.num_nodes, versions=[
    File "/home/thestack/bitcoin/test/functional/test_framework/test_framework.py", line 537, in add_nodes
      raise AssertionError("At least one release binary is missing")
  AssertionError: At least one release binary is missing
  2025-01-01T20:26:28.061000Z TestFramework (INFO): Stopping nodes
  ...
  ```

ACKs for top commit:
  fjahr:
    re-ACK 1ea7e45a1f
  kevkevinpal:
    ACK [1ea7e45](1ea7e45a1f)
  maflcko:
    lgtm ACK 1ea7e45a1f
  achow101:
    ACK 1ea7e45a1f
  pablomartin4btc:
    tACK 1ea7e45a1f

Tree-SHA512: b621c3ce044ca8fc8715a4f4b1f96a8592a470c319a64444cced9ba692d315cfd4885a066679bf377b19136fa3530d9cff6f18894a45aa9c716d39b12719baa0
2025-01-09 18:22:26 -05:00
.github ci, macos: Install pkgconf Homebrew's package 2024-12-01 10:58:15 +00:00
.tx qt: Bump Transifex slug for 28.x 2024-07-30 16:14:19 +01:00
ci ci: Run functional tests in msan task 2025-01-02 13:46:52 +01:00
cmake build: Use character literals for generated headers to avoid narrowing 2024-12-20 14:37:31 +01:00
contrib guix: disable timezone tools & profiling in glibc 2024-12-18 13:30:24 +00:00
depends depends: Update capnproto to 1.1.0 2024-12-21 17:39:19 +00:00
doc Merge bitcoin/bitcoin#31526: doc: Install net/py-pyzmq port on FreeBSD for interface_zmq.py 2025-01-06 11:36:11 +00:00
share build: Rename PACKAGE_* variables to CLIENT_* 2024-10-28 12:35:55 +00:00
src miner: add package feerate vector to CBlockTemplate 2025-01-07 15:29:17 -05:00
test test: raise explicit error if any of the needed release binaries is missing 2025-01-07 01:25:15 +01:00
.cirrus.yml ci: Skip broken Wine64 tests by default 2024-11-13 18:38:24 +01:00
.editorconfig code style: update .editorconfig file 2024-09-13 17:55:10 +02:00
.gitattributes Separate protocol versioning from clientversion 2014-10-29 00:24:40 -04:00
.gitignore build: Remove Autotools-based build system 2024-08-30 21:31:39 +01:00
.python-version Bump python minimum supported version to 3.10 2024-08-28 15:53:07 +02:00
.style.yapf Update .style.yapf 2023-06-01 23:35:10 +05:30
CMakeLists.txt build: use -mbig-obj for mingw-w64 Debug builds 2024-12-13 14:44:30 +00:00
CMakePresets.json cmake: Remove unused BUILD_TESTING variable from "dev-mode" preset 2024-12-19 22:25:11 +00:00
CONTRIBUTING.md doc: remove PR Review Club frequency 2024-11-20 11:16:39 +01:00
COPYING doc: upgrade Bitcoin Core license to 2024 2024-01-10 16:29:01 -06:00
INSTALL.md doc: Added hyperlink for doc/build 2021-09-09 19:53:12 +05:30
libbitcoinkernel.pc.in build: Rename PACKAGE_* variables to CLIENT_* 2024-10-28 12:35:55 +00:00
README.md doc: cmake: prepend and explain "build/" where needed 2024-10-11 11:24:21 -06:00
SECURITY.md Update security.md contact for achow101 2023-12-14 18:14:54 -05:00
vcpkg.json Remove wallet::ParseISO8601DateTime, use ParseISO8601DateTime instead 2024-12-02 15:09:31 +01:00

Bitcoin Core integration/staging tree

https://bitcoincore.org

For an immediately usable, binary version of the Bitcoin Core software, see https://bitcoincore.org/en/download/.

What is Bitcoin Core?

Bitcoin Core connects to the Bitcoin peer-to-peer network to download and fully validate blocks and transactions. It also includes a wallet and graphical user interface, which can be optionally built.

Further information about Bitcoin Core is available in the doc folder.

License

Bitcoin Core is released under the terms of the MIT license. See COPYING for more information or see https://opensource.org/licenses/MIT.

Development Process

The master branch is regularly built (see doc/build-*.md for instructions) and tested, but it is not guaranteed to be completely stable. Tags are created regularly from release branches to indicate new official, stable release versions of Bitcoin Core.

The https://github.com/bitcoin-core/gui repository is used exclusively for the development of the GUI. Its master branch is identical in all monotree repositories. Release branches and tags do not exist, so please do not fork that repository unless it is for development reasons.

The contribution workflow is described in CONTRIBUTING.md and useful hints for developers can be found in doc/developer-notes.md.

Testing

Testing and code review is the bottleneck for development; we get more pull requests than we can review and test on short notice. Please be patient and help out by testing other people's pull requests, and remember this is a security-critical project where any mistake might cost people lots of money.

Automated Testing

Developers are strongly encouraged to write unit tests for new code, and to submit new unit tests for old code. Unit tests can be compiled and run (assuming they weren't disabled during the generation of the build system) with: ctest. Further details on running and extending unit tests can be found in /src/test/README.md.

There are also regression and integration tests, written in Python. These tests can be run (if the test dependencies are installed) with: build/test/functional/test_runner.py (assuming build is your build directory).

The CI (Continuous Integration) systems make sure that every pull request is built for Windows, Linux, and macOS, and that unit/sanity tests are run automatically.

Manual Quality Assurance (QA) Testing

Changes should be tested by somebody other than the developer who wrote the code. This is especially important for large or high-risk changes. It is useful to add a test plan to the pull request description if testing the changes is not straightforward.

Translations

Changes to translations as well as new translations can be submitted to Bitcoin Core's Transifex page.

Translations are periodically pulled from Transifex and merged into the git repository. See the translation process for details on how this works.

Important: We do not accept translation changes as GitHub pull requests because the next pull from Transifex would automatically overwrite them again.