aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMacroFake <falke.marco@gmail.com>2022-05-15 09:19:41 +0200
committerMacroFake <falke.marco@gmail.com>2022-05-15 09:19:43 +0200
commitb74a6dde8cf50703a8814d402333580e4cdfea59 (patch)
tree7095178d734d33e7dc23e7549bbbcd53c85d009d /test
parent225e5b57b2ee2bc1acd7f09c89ccccc15ef8c85f (diff)
parent4faa5500724e3b1423ce1f927236b1ab1ac07943 (diff)
downloadbitcoin-b74a6dde8cf50703a8814d402333580e4cdfea59.tar.xz
Merge bitcoin/bitcoin#25123: test: Fix race condition in index prune test
4faa5500724e3b1423ce1f927236b1ab1ac07943 test: Fix race condition in index pruning test (Fabian Jahr) Pull request description: Fixes #25031 The `feature_index_prune.py` test seems to be racy because connections are reestablished after restarts and the blocks are synced via the `sync_blocks` function. The `sync_blocks` function has a sanity check at the beginning to check that all nodes in the set have at least one established connection and that is not always the case. As a solution nodes are not connected via the `-connect` parameter on start but instead via the `connect_nodes` helper. Top commit has no ACKs. Tree-SHA512: f88377715f455f1620725fe8ebd6b486fa0209660b193bf68d1ce1452e2086ac5d169d8ca4c2b61443566232e96fb9c6386ee482bc546cce38078d72e7c3c29f
Diffstat (limited to 'test')
-rwxr-xr-xtest/functional/feature_index_prune.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/test/functional/feature_index_prune.py b/test/functional/feature_index_prune.py
index 2bf57db923..3ee6a8036c 100755
--- a/test/functional/feature_index_prune.py
+++ b/test/functional/feature_index_prune.py
@@ -8,7 +8,6 @@ from test_framework.util import (
assert_equal,
assert_greater_than,
assert_raises_rpc_error,
- p2p_port,
)
@@ -132,11 +131,11 @@ class FeatureIndexPruneTest(BitcoinTestFramework):
self.nodes[i].assert_start_raises_init_error(extra_args=self.extra_args[i], expected_msg=msg)
self.log.info("make sure the nodes start again with the indices and an additional -reindex arg")
- ip_port = "127.0.0.1:" + str(p2p_port(3))
for i in range(3):
- # The nodes need to be reconnected to the non-pruning node upon restart, otherwise they will be stuck
- restart_args = self.extra_args[i]+["-reindex", f"-connect={ip_port}"]
+ restart_args = self.extra_args[i]+["-reindex"]
self.restart_node(i, extra_args=restart_args)
+ # The nodes need to be reconnected to the non-pruning node upon restart, otherwise they will be stuck
+ self.connect_nodes(i, 3)
self.sync_blocks(timeout=300)