aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2024-03-19 13:49:49 +0000
committerfanquake <fanquake@gmail.com>2024-03-19 14:09:02 +0000
commit9f2609de09eb6299548e4c56b0f325361c5ad781 (patch)
treecf9582d07d8f20b04b5e5c840e2c9de3ca31c96e /test
parent0f89e8651650de69f0da3d02de790159a5d148b3 (diff)
parent432a542e271f5b6ecb1c6ea4fa9108ad4b3a5a43 (diff)
Merge bitcoin/bitcoin#29639: test: fix intermittent failures with test=addrman
432a542e271f5b6ecb1c6ea4fa9108ad4b3a5a43 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](https://github.com/bitcoin/bitcoin/pull/29639/commits/432a542e271f5b6ecb1c6ea4fa9108ad4b3a5a43) stratospher: Tested ACK 432a542e271f5b6ecb1c6ea4fa9108ad4b3a5a43. brunoerg: crACK 432a542e271f5b6ecb1c6ea4fa9108ad4b3a5a43 0xB10C: ACK 432a542e271f5b6ecb1c6ea4fa9108ad4b3a5a43 Tree-SHA512: a8e284baeb0be2df7284b8a2792cb9edc9e2d5b877a3b29ab7277ffdb75b17efa58a4d42576441eb493cd518e7c5ffdb05597b27e42b5001cf1a80e78bb04c83
Diffstat (limited to 'test')
-rwxr-xr-xtest/functional/feature_asmap.py3
-rwxr-xr-xtest/functional/rpc_net.py4
2 files changed, 5 insertions, 2 deletions
diff --git a/test/functional/feature_asmap.py b/test/functional/feature_asmap.py
index 7e32f8d515..024a8fa18c 100755
--- a/test/functional/feature_asmap.py
+++ b/test/functional/feature_asmap.py
@@ -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."""
diff --git a/test/functional/rpc_net.py b/test/functional/rpc_net.py
index 265d9d959a..22789644f2 100755
--- a/test/functional/rpc_net.py
+++ b/test/functional/rpc_net.py
@@ -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")