test: fix intermittent failures with test=addrman

The nKey of the addrman is generated the first time the node is
started. Therefore, restarting a node or turning it off and on
again won't make a previously non-deterministic addrman
deterministic.

Co-authored-by: 0xb10c <b10c@b10c.me>
This commit is contained in:
Martin Zumsande
2024-03-12 14:00:23 -04:00
parent bde3db40f6
commit 432a542e27
2 changed files with 5 additions and 2 deletions

View File

@@ -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")