HomePhabricator

test: avoid non-determinism in asmap-addrman test

Description

test: avoid non-determinism in asmap-addrman test

Summary:

The probability of collision when adding an addrman entry is
expected to be 1/2^16 = 1/65536 for an address from a different /16.

This change hopes to avoid these collisions by adding 1 tried entry before adding 1 new table one, instead of 2 tried entries followed by 2 new entries, which appears to have caused a collision in the CI.

Backport of core#23084.

Test Plan:
In a loop:

./test/functional/test_runner.py feature_asmap

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

Differential Revision: https://reviews.bitcoinabc.org/D12363

Details

Provenance
Jon Atack <jon@atack.com>Authored on Sep 24 2021, 10:26
FabienCommitted on Oct 24 2022, 14:12
FabienPushed on Oct 24 2022, 14:12
Reviewer
Restricted Project
Differential Revision
D12363: test: avoid non-determinism in asmap-addrman test
Parents
rABC9f8c2b711e1d: [test] call CheckPackage for package sanitization checks
Branches
Unknown
Tags
Unknown