Skip to content

Commit

Permalink
[test] Use deterministic addrman in asmap-addrman test
Browse files Browse the repository at this point in the history
  • Loading branch information
stratospher committed Dec 5, 2023
1 parent 2474dd1 commit 964e1a8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/functional/feature_asmap.py
Expand Up @@ -42,8 +42,8 @@ def set_test_params(self):
self.extra_args = [["-checkaddrman=1"]] # Do addrman checks on all operations.

def fill_addrman(self, node_id):
"""Add 1 tried address to the addrman, followed by 1 new address."""
for addr, tried in [[0, True], [1, False]]:
"""Add 2 tried address to the addrman, followed by 2 new address."""
for addr, tried in [[0, True], [1, True], [2, False], [3, False]]:
self.nodes[node_id].addpeeraddress(address=f"101.{addr}.0.0", tried=tried, port=8333)

def test_without_asmap_arg(self):
Expand Down Expand Up @@ -84,12 +84,12 @@ def test_asmap_interaction_with_addrman_containing_entries(self):
self.log.info("Test bitcoind -asmap restart with addrman containing new and tried entries")
self.stop_node(0)
shutil.copyfile(self.asmap_raw, self.default_asmap)
self.start_node(0, ["-asmap", "-checkaddrman=1"])
self.start_node(0, ["-asmap", "-checkaddrman=1", "-addrtest=addrman"])
self.fill_addrman(node_id=0)
self.restart_node(0, ["-asmap", "-checkaddrman=1"])
self.restart_node(0, ["-asmap", "-checkaddrman=1", "-addrtest=addrman"])
with self.node.assert_debug_log(
expected_msgs=[
"CheckAddrman: new 1, tried 1, total 2 started",
"CheckAddrman: new 2, tried 2, total 4 started",
"CheckAddrman: completed",
]
):
Expand Down

0 comments on commit 964e1a8

Please sign in to comment.