-
Notifications
You must be signed in to change notification settings - Fork 35.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[init] Create deterministic addrman in tests using -test=addrman
Supposing there are 2 different addresses to be placed in an addrman table. During every test run, a different [bucket,position] would be calculated for each address. These calculated [bucket,position] could end up being the same for the 2 different addresses in some test runs and result in collisions in the addrman. We wouldn't be able to predict when the collisions are going to happen because we can't predict the nKey value which is chosen at random. This can cause flaky tests. Improve this by allowing deterministic addrman creation in the functional tests. This creates an addrman with fixed `nKey` = 1 and we can know the [bucket,position] collisions beforehand, safely add more addresses in an addrman table and write more extensive tests.
- Loading branch information
1 parent
be25ac3
commit 69e091f
Showing
2 changed files
with
6 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters