HomePhabricator

[backport#16756] test: Connection eviction logic tests

Description

[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

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

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

Details

Provenance
MarcoFalke <falke.marco@gmail.com>Authored on Jun 12 2020, 18:48
majcostaCommitted on May 13 2021, 11:55
majcostaPushed on May 13 2021, 11:55
Reviewer
Restricted Project
Differential Revision
D9510: [backport#16756] test: Connection eviction logic tests
Parents
rABC17e728e7bbe2: [Automated] Update timing.json
Branches
Unknown
Tags
Unknown