Skip to content

Commit

Permalink
test: skip test if any of the needed release binaries is missing
Browse files Browse the repository at this point in the history
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 skip the test in this case. Noticed while testing bitcoin#30328.

Can be tested by e.g.

$ ./test/get_previous_releases -b
$ rm -rf ./releases/v28.0/
$ ./build/test/functional/wallet_migration.py
  • Loading branch information
theStack committed Dec 10, 2024
1 parent 37e49c2 commit 2a1bb04
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/functional/test_framework/test_framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,14 @@ def get_bin_from_version(version, bin_name, bin_default):
binary = [get_bin_from_version(v, 'bitcoind', self.options.bitcoind) for v in versions]
if binary_cli is None:
binary_cli = [get_bin_from_version(v, 'bitcoin-cli', self.options.bitcoincli) for v in versions]
# Skip test if any of the needed release binaries is missing
bins_missing = False
for bin_path in binary + binary_cli:
if not os.path.exists(bin_path):
self.log.error(f"Binary not found: {bin_path}")
bins_missing = True
if bins_missing:
raise SkipTest("At least one release binary is missing")
assert_equal(len(extra_confs), num_nodes)
assert_equal(len(extra_args), num_nodes)
assert_equal(len(versions), num_nodes)
Expand Down

0 comments on commit 2a1bb04

Please sign in to comment.