Skip to content

Commit be72ae2

Browse files
committed
Merge bitcoin/bitcoin#23996: test: set ban after mocking time
c9374af test: set ban after mocking time (brunoerg) Pull request description: Fixes #23988 Set ban after mocking time to avoid intermittent failures related to the assertion of ban_duration and time_remaining. See: https://cirrus-ci.com/task/6754020390862848?logs=ci#L4652 ACKs for top commit: mzumsande: Tested ACK c9374af vincenzopalazzo: ACK bitcoin/bitcoin@c9374af Tree-SHA512: fac3ac91a045bb46334d7c568f6a53a3b0a45b306914a54ea13bcc845734eaaad1ff295ff3ab158037fd9d08df77344058331336110b8f7888832b16b0589be5
2 parents 95833c0 + c9374af commit be72ae2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/functional/p2p_disconnect_ban.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ def run_test(self):
5757
assert_equal(len(self.nodes[1].listbanned()), 0)
5858

5959
self.log.info("setban: test persistence across node restart")
60-
self.nodes[1].setban("127.0.0.0/32", "add")
61-
self.nodes[1].setban("127.0.0.0/24", "add")
6260
# Set the mocktime so we can control when bans expire
6361
old_time = int(time.time())
6462
self.nodes[1].setmocktime(old_time)
63+
self.nodes[1].setban("127.0.0.0/32", "add")
64+
self.nodes[1].setban("127.0.0.0/24", "add")
6565
self.nodes[1].setban("192.168.0.1", "add", 1) # ban for 1 seconds
6666
self.nodes[1].setban("2001:4d48:ac57:400:cacf:e9ff:fe1d:9c63/19", "add", 1000) # ban for 1000 seconds
6767
listBeforeShutdown = self.nodes[1].listbanned()

0 commit comments

Comments
 (0)