Page MenuHomePhabricator

Fix a rare failure in the peermanager tests
ClosedPublic

Authored by Fabien on Nov 10 2020, 08:21.

Details

Reviewers
PiRK
Group Reviewers
Restricted Project
Commits
rABCb8f762ba7906: Fix a rare failure in the peermanager tests
Summary

The randrange() method expects the range to be non zero.
In the peermanager_tests/select_peer_random case the max variable
can be 0 and fail the test. Since we still want to test slot 0, set slot = 0
when max == 0 without calling the randrange() method.

Test Plan
ninja check-avalanche

Diff Detail

Repository
rABC Bitcoin ABC
Branch
fix_peermanager_tests_randrange
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 13958
Build 27924: Build Difflint-circular-dependencies · build-without-wallet · build-diff · build-clang-tidy · build-debug · build-clang
Build 27923: arc lint + arc unit

Event Timeline

Fabien requested review of this revision.Nov 10 2020, 08:21
PiRK added a subscriber: PiRK.

I updated the revision so that the last line does not start with a = because it was parsed as a very large title.

This revision is now accepted and ready to land.Nov 10 2020, 08:45
This revision was automatically updated to reflect the committed changes.