Skip to content

Commit 8f0947b

Browse files
morcossdaftuar
authored andcommitted
Increase timeouts in pruning.py and modify warning language.
1 parent b89f307 commit 8f0947b

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

qa/rpc-tests/pruning.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
# Test pruning code
88
# ********
99
# WARNING:
10-
# This test uses 4GB of disk space and takes in excess of 30 mins to run
10+
# This test uses 4GB of disk space.
11+
# This test takes 30 mins or more (up to 2 hours)
1112
# ********
1213

1314
from test_framework import BitcoinTestFramework
@@ -51,11 +52,11 @@ def setup_network(self):
5152
self.is_network_split = False
5253

5354
# Create nodes 0 and 1 to mine
54-
self.nodes.append(start_node(0, self.options.tmpdir, ["-debug","-maxreceivebuffer=20000","-blockmaxsize=999000", "-checkblocks=5"], timewait=300))
55-
self.nodes.append(start_node(1, self.options.tmpdir, ["-debug","-maxreceivebuffer=20000","-blockmaxsize=999000", "-checkblocks=5"], timewait=300))
55+
self.nodes.append(start_node(0, self.options.tmpdir, ["-debug","-maxreceivebuffer=20000","-blockmaxsize=999000", "-checkblocks=5"], timewait=900))
56+
self.nodes.append(start_node(1, self.options.tmpdir, ["-debug","-maxreceivebuffer=20000","-blockmaxsize=999000", "-checkblocks=5"], timewait=900))
5657

5758
# Create node 2 to test pruning
58-
self.nodes.append(start_node(2, self.options.tmpdir, ["-debug","-maxreceivebuffer=20000","-prune=550"], timewait=300))
59+
self.nodes.append(start_node(2, self.options.tmpdir, ["-debug","-maxreceivebuffer=20000","-prune=550"], timewait=900))
5960
self.prunedir = self.options.tmpdir+"/node2/regtest/blocks/"
6061

6162
self.address[0] = self.nodes[0].getnewaddress()
@@ -108,7 +109,7 @@ def create_chain_with_staleblocks(self):
108109
# Node 2 stays connected, so it hears about the stale blocks and then reorg's when node0 reconnects
109110
# Stopping node 0 also clears its mempool, so it doesn't have node1's transactions to accidentally mine
110111
stop_node(self.nodes[0],0)
111-
self.nodes[0]=start_node(0, self.options.tmpdir, ["-debug","-maxreceivebuffer=20000","-blockmaxsize=999000", "-checkblocks=5"], timewait=300)
112+
self.nodes[0]=start_node(0, self.options.tmpdir, ["-debug","-maxreceivebuffer=20000","-blockmaxsize=999000", "-checkblocks=5"], timewait=900)
112113
# Mine 24 blocks in node 1
113114
self.utxo = self.nodes[1].listunspent()
114115
for i in xrange(24):
@@ -135,7 +136,7 @@ def reorg_test(self):
135136
# Reboot node 1 to clear its mempool (hopefully make the invalidate faster)
136137
# Lower the block max size so we don't keep mining all our big mempool transactions (from disconnected blocks)
137138
stop_node(self.nodes[1],1)
138-
self.nodes[1]=start_node(1, self.options.tmpdir, ["-debug","-maxreceivebuffer=20000","-blockmaxsize=5000", "-checkblocks=5", "-disablesafemode"], timewait=300)
139+
self.nodes[1]=start_node(1, self.options.tmpdir, ["-debug","-maxreceivebuffer=20000","-blockmaxsize=5000", "-checkblocks=5", "-disablesafemode"], timewait=900)
139140

140141
height = self.nodes[1].getblockcount()
141142
print "Current block height:", height
@@ -158,7 +159,7 @@ def reorg_test(self):
158159

159160
# Reboot node1 to clear those giant tx's from mempool
160161
stop_node(self.nodes[1],1)
161-
self.nodes[1]=start_node(1, self.options.tmpdir, ["-debug","-maxreceivebuffer=20000","-blockmaxsize=5000", "-checkblocks=5", "-disablesafemode"], timewait=300)
162+
self.nodes[1]=start_node(1, self.options.tmpdir, ["-debug","-maxreceivebuffer=20000","-blockmaxsize=5000", "-checkblocks=5", "-disablesafemode"], timewait=900)
162163

163164
print "Generating new longer chain of 300 more blocks"
164165
self.nodes[1].generate(300)
@@ -223,7 +224,7 @@ def reorg_back(self):
223224
waitstart = time.time()
224225
while self.nodes[2].getblockcount() < goalbestheight:
225226
time.sleep(0.1)
226-
if time.time() - waitstart > 300:
227+
if time.time() - waitstart > 900:
227228
raise AssertionError("Node 2 didn't reorg to proper height")
228229
assert(self.nodes[2].getbestblockhash() == goalbesthash)
229230
# Verify we can now have the data for a block previously pruned
@@ -256,7 +257,7 @@ def mine_full_block(self, node, address):
256257

257258

258259
def run_test(self):
259-
print "Warning! This test requires 4GB of disk space and takes over 30 mins"
260+
print "Warning! This test requires 4GB of disk space and takes over 30 mins (up to 2 hours)"
260261
print "Mining a big blockchain of 995 blocks"
261262
self.create_big_chain()
262263
# Chain diagram key:

0 commit comments

Comments
 (0)