Skip to content

test: check ban_duration and time_remaining after setting ban - #23879

Merged
maflcko merged 1 commit into
bitcoin:masterfrom
brunoerg:2021-12-test-ban_duration-time_remaining
Dec 30, 2021
Merged

maflcko merged 1 commit into
bitcoin:masterfrom
brunoerg:2021-12-test-ban_duration-time_remaining

Conversation

@brunoerg

Copy link
Copy Markdown
Contributor

This PR adds functional test coverage for ban_duration and time_remaining introduced in #21602

@DrahtBot DrahtBot added the Tests label Dec 27, 2021

@shaavan shaavan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK da349f1

The added test logically makes sense.

Summary:

  • The test checks for the ban_duration and time_remaining for the subnets banned in the above code.
  • time_remaining for each of them should be 3 seconds less than their ban_duration as mocktime has been moved up by 3 seconds in the above code.
self.nodes[1].setmocktime(old_time + 3)

I tested that the test passed successfully on the PR branch.

@theStack theStack left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested ACK da349f1

For historical reference, these fields (ban_duration, time_remaining) were introduced in PR #21602, which also included unit tests (commit 60290d3). Can't hurt to also check these in the functional tests!

@maflcko
maflcko merged commit f3d6a5c into bitcoin:master Dec 30, 2021
Comment thread test/functional/p2p_disconnect_ban.py Resolved
@bitcoin bitcoin locked and limited conversation to collaborators Jan 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants