Skip to content

Commit 835f5c7

Browse files
committed
[prep/test] restart instead of bumpmocktime between p2p_orphan_handling subtests
If we want to restart at all during the tests, we can't have future timestamps.
1 parent b113877 commit 835f5c7

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

test/functional/p2p_orphan_handling.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,22 +44,20 @@
4444
TXREQUEST_TIME_SKIP = NONPREF_PEER_TX_DELAY + TXID_RELAY_DELAY + OVERLOADED_PEER_TX_DELAY + 1
4545

4646
def cleanup(func):
47-
# Time to fastfoward (using setmocktime) in between subtests to ensure they do not interfere with
48-
# one another, in seconds. Equal to 12 hours, which is enough to expire anything that may exist
49-
# (though nothing should since state should be cleared) in p2p data structures.
50-
LONG_TIME_SKIP = 12 * 60 * 60
51-
5247
def wrapper(self):
5348
try:
5449
func(self)
5550
finally:
5651
# Clear mempool
5752
self.generate(self.nodes[0], 1)
5853
self.nodes[0].disconnect_p2ps()
59-
self.nodes[0].bumpmocktime(LONG_TIME_SKIP)
6054
# Check that mempool and orphanage have been cleared
6155
self.wait_until(lambda: len(self.nodes[0].getorphantxs()) == 0)
6256
assert_equal(0, len(self.nodes[0].getrawmempool()))
57+
58+
self.restart_node(0, extra_args=["-persistmempool=0"])
59+
# Allow use of bumpmocktime again
60+
self.nodes[0].setmocktime(int(time.time()))
6361
self.wallet.rescan_utxos(include_mempool=True)
6462
return wrapper
6563

0 commit comments

Comments
 (0)