-
Notifications
You must be signed in to change notification settings - Fork 36.9k
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
test: add coverage for -bantime
#26604
Conversation
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. 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. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
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.
Concept ACK
I was testing ChatGPT to see if it can review pull requests and it suggested 4 improvements that make sense:
Thanks, @1440000bytes for your review. Interesting experiment using an AI, however, I believe it doesn't deal so well with some specific stuff from our framework. E.g. It doesn't know 100% what our |
9be1a6c
to
9c18992
Compare
self.log.info("Test -bantime") | ||
self.restart_node(1, ["-bantime=1234"]) | ||
self.nodes[1].setban("127.0.0.1", "add") | ||
banned = self.nodes[1].listbanned()[0] |
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.
tAck but how about adding another coverage to test the ban remaining time after the bantime elapsed.
time.sleep(secs)
banned = self.nodes[1].listbanned()[0]
assert_equal(banned["time_remaining"],0)
lgtm ACK 9c18992 |
9c18992 test: add coverage for `-bantime` (brunoerg) Pull request description: This PR adds test coverage for `-bantime`. This flag sets the time in seconds how long the IP is banned (in the case you don't explicitly set `bantime` when using `setban`). ACKs for top commit: MarcoFalke: lgtm ACK 9c18992 Tree-SHA512: e95f8608aa5df9b09cc5577daae662ed79ef5d5c69ee5e704d7c69520b9b51cc142e9e6be69d80356eda25a5215c4770b1a208638560c48cd3bc8f6d195a371f
This PR adds test coverage for
-bantime
. This flag sets the time in seconds how long the IP is banned (in the case you don't explicitly setbantime
when usingsetban
).