mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-11 04:12:36 -03:00
Merge bitcoin/bitcoin#25123: test: Fix race condition in index prune test
4faa550072
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
This commit is contained in:
commit
b74a6dde8c
1 changed files with 3 additions and 4 deletions
|
@ -8,7 +8,6 @@ from test_framework.util import (
|
||||||
assert_equal,
|
assert_equal,
|
||||||
assert_greater_than,
|
assert_greater_than,
|
||||||
assert_raises_rpc_error,
|
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.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")
|
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):
|
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"]
|
||||||
restart_args = self.extra_args[i]+["-reindex", f"-connect={ip_port}"]
|
|
||||||
self.restart_node(i, extra_args=restart_args)
|
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)
|
self.sync_blocks(timeout=300)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue