Page MenuHomePhabricator

[backport#16756] test: Connection eviction logic tests
ClosedPublic

Authored by majcosta on May 12 2021, 16:43.

Details

Reviewers
PiRK
Group Reviewers
Restricted Project
Commits
rABC607527e0dbd6: [backport#16756] test: Connection eviction logic tests
Summary

45eff751c6d07007dabc365dc4c0e6c63e3fe5cf Add functional test for P2P eviction logic of inbound peers (Martin Zumsande)

Pull request description:

This adds a functional test for the eviction logic for inbound peers, which is triggered when the number of maximum connections is exceeded.

The functional test covers eviction protection for peers that  have sent us blocks or txns recently, or that have faster pings. I couldn't find a way to test the logic of `CConnman::AttemptToEvictConnection` that is based on netgroup (see #14210 for related discussion)

Fixes #16660 (at least partially).

[Edit: Earlier, this PR also contained a unit test, which was removed after the discussion]

Backport of core#16756

Test Plan
ninja all && ./test/test_runner.py p2p_eviction

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable