mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-19 05:45:05 +01:00
Merge bitcoin/bitcoin#29639: test: fix intermittent failures with test=addrman
432a542e27
test: fix intermittent failures with test=addrman (Martin Zumsande) Pull request description: The `nKey` of the addrman is generated the first time the node is started with an empty `peers.dat`. Therefore, restarting a node or turning it off and on again won't make a previously non-deterministic addrman deterministic. This could lead to intermittent failures in `feature_asmap.py` and `rpc_net.py` Fixes #29634 ACKs for top commit: kevkevinpal: ACK [432a542
](432a542e27
) stratospher: Tested ACK432a542e27
. brunoerg: crACK432a542e27
0xB10C: ACK432a542e27
Tree-SHA512: a8e284baeb0be2df7284b8a2792cb9edc9e2d5b877a3b29ab7277ffdb75b17efa58a4d42576441eb493cd518e7c5ffdb05597b27e42b5001cf1a80e78bb04c83
This commit is contained in:
commit
9f2609de09
@ -39,7 +39,8 @@ def expected_messages(filename):
|
||||
class AsmapTest(BitcoinTestFramework):
|
||||
def set_test_params(self):
|
||||
self.num_nodes = 1
|
||||
self.extra_args = [["-checkaddrman=1"]] # Do addrman checks on all operations.
|
||||
# Do addrman checks on all operations and use deterministic addrman
|
||||
self.extra_args = [["-checkaddrman=1", "-test=addrman"]]
|
||||
|
||||
def fill_addrman(self, node_id):
|
||||
"""Add 2 tried addresses to the addrman, followed by 2 new addresses."""
|
||||
|
@ -319,7 +319,9 @@ class NetTest(BitcoinTestFramework):
|
||||
|
||||
def test_addpeeraddress(self):
|
||||
self.log.info("Test addpeeraddress")
|
||||
self.restart_node(1, ["-checkaddrman=1", "-test=addrman"])
|
||||
# The node has an existing, non-deterministic addrman from a previous test.
|
||||
# Clear it to have a deterministic addrman.
|
||||
self.restart_node(1, ["-checkaddrman=1", "-test=addrman"], clear_addrman=True)
|
||||
node = self.nodes[1]
|
||||
|
||||
self.log.debug("Test that addpeerinfo is a hidden RPC")
|
||||
|
Loading…
Reference in New Issue
Block a user