Skip to content

Commit 920e85d

Browse files
committed
test: adjust mocktime bump to match upstream in p2p_disconnect_ban
1 parent b1a95d8 commit 920e85d

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

test/functional/p2p_disconnect_ban.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,15 @@ def run_test(self):
7474
self.nodes[1].setban("2001:4d48:ac57:400:cacf:e9ff:fe1d:9c63/19", "add", 1000) # ban for 1000 seconds
7575
listBeforeShutdown = self.nodes[1].listbanned()
7676
assert_equal("192.168.0.1/32", listBeforeShutdown[2]['address'])
77-
self.bump_mocktime(2)
77+
# Move time forward by 3 seconds so the third ban has expired
78+
self.bump_mocktime(3)
7879
self.wait_until(lambda: len(self.nodes[1].listbanned()) == 3, timeout=10)
7980

8081
self.log.info("Test ban_duration and time_remaining")
8182
for ban in self.nodes[1].listbanned():
8283
if ban["address"] in ["127.0.0.0/32", "127.0.0.0/24"]:
8384
assert_equal(ban["ban_duration"], 86400)
84-
assert_equal(ban["time_remaining"], 86398)
85+
assert_equal(ban["time_remaining"], 86397)
8586
elif ban["address"] == "2001:4d48:ac57:400:cacf:e9ff:fe1d:9c63/19":
8687
assert_equal(ban["ban_duration"], 1000)
8788
assert_equal(ban["time_remaining"], 997)

0 commit comments

Comments
 (0)