-
Notifications
You must be signed in to change notification settings - Fork 38.7k
test: adds outbound eviction functional tests, updates comment in ConsiderEviction #29122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code CoverageFor detailed information about the code coverage, see the test coverage report. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. ConflictsNo conflicts as of last run. |
|
While the tests seem to run fine, I noticed a warning that appears every now and then: I'm not sure if something unintended is happening under the hood. Disconnections are expected, but it's our node who is supposed to trigger them, so maybe I'm missing something. |
445ddda to
cd11dab
Compare
a6590c0 to
6d6eda7
Compare
6d6eda7 to
9ba568c
Compare
1444a26 to
8833aa6
Compare
8833aa6 to
599e984
Compare
599e984 to
2e15c4f
Compare
2e15c4f to
24b7906
Compare
|
Rebased to fix CI |
24b7906 to
b8b2370
Compare
|
Rebased. This has failed CI once when waiting for the disconnection after: I've tried to reproduce it but I cannot in my local setup, the only thing that comes to mind is that mock time may be too close to the timeout (only one second ahead), so I gave it a delta of 10 seconds instead. PS: For context, you can check the failure here: https://cirrus-ci.com/task/4624744360706048?logs=ci#L6520. See how the peer is given the final notice by sending a getheaders message, but the check is performed before the peer gets disconnected. |
b8b2370 to
edc14bc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent work finding a gap and filling it by increasing functional test robustness.
ACK for edc14bc9da332cae39f8803db559b532b3c74e16
Checked out the PR branch, built, and ran all functional tests (all passed).
The review was focused on verifying edge case coverage of the tests and that tests will accurately catch both pass and fail conditions.
Did not observe previously reported warning message:
TestFramework.p2p (WARNING): Connection lost to 0:0 due to [Errno 54] Connection reset by peer
sr-gi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review @tdb3
|
I redefined how peers are split in |
91005f7 to
986329f
Compare
15a00a9 to
8980e15
Compare
|
Rebased on top of #29736. Now this is using cc/ @stratospher |
8980e15 to
be2c551
Compare
|
🚧 At least one of the CI tasks failed. Make sure to run all tests locally, according to the Possibly this is due to a silent merge conflict (the changes in this pull request being Leave a comment here, if you need help tracking down a confusing failure. |
|
ACK be2c551 It is worth noting that these tests will not catch if outbound eviction logic gets triggered too early. e.g.: /** How long to wait for a peer to respond to a getheaders request */
static constexpr auto HEADERS_RESPONSE_TIME{0s};
// [...]
/** Timeout for (unprotected) outbound peers to sync to our chainwork */
static constexpr auto CHAIN_SYNC_TIMEOUT{0s};will pass. That seems fine to me, maybe something for a follow up. |
Peer protection is only given to outbound-full-relay peers. Add a negative test to check that other type of outbound peers are not given protection under the circumstances that outbound-full-relay would
I don't think I follow you here. |
be2c551 to
d53d848
Compare
|
Updated to address #29122 (comment) |
|
reACK d53d848
I didn't mean to say that these tests should be responsible for enforcing the particular values of Anyways, I think if what I'm saying isn't confused in some way, it is more pedantic than useful. |
cbergqvist
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK d53d848
Functional including --extended tests passed (skipped unrelated feature_dbcrash).
|
Re ACK for d53d848 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Re ACK. Reviewed the code and the tests look good to me. I ran p2p_outbound_eviction.py individually and along with all the other functional tests and everything looks good.
|
ACK d53d848 |
Motivation
While checking the outbound eviction code I realized a case was not considered within the comments, which in turn made me realize we had no functional tests for the outbound eviction case (when I went to check/add the test case).
This PR updates the aforementioned comment and adds functional tests to cover the outbound eviction logic, in addition to the existing unit tests found at
src/test/denialofservice_tests.cpp.