Skip to content

Commit 45d8b71

Browse files
author
MarcoFalke
committed
Merge #15696: [qa] test_runner: Move feature_pruning to base tests
fafb55e [qa] test_runner: Move feature_pruning to base tests (MarcoFalke) 8728a66 [tests] fix block time in feature_pruning.py (John Newbery) Pull request description: ACKs for commit fafb55: Tree-SHA512: 88abef94379fbad6629da11dccb080d5f0644490d6f2cc2756a33fac34bcf72e84245cef596dfae5a40f7a99b3f4da0dd85d306d4c1b452d310d3f36eef75a8b
2 parents ce67620 + fafb55e commit 45d8b71

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

test/functional/feature_pruning.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,17 @@ def mine_large_blocks(node, n):
3535
# followed by 950k of OP_NOP. This would be non-standard in a non-coinbase
3636
# transaction but is consensus valid.
3737

38+
# Set the nTime if this is the first time this function has been called.
39+
# A static variable ensures that time is monotonicly increasing and is therefore
40+
# different for each block created => blockhash is unique.
41+
if "nTimes" not in mine_large_blocks.__dict__:
42+
mine_large_blocks.nTime = 0
43+
3844
# Get the block parameters for the first block
3945
big_script = CScript([OP_RETURN] + [OP_NOP] * 950000)
4046
best_block = node.getblock(node.getbestblockhash())
4147
height = int(best_block["height"]) + 1
42-
try:
43-
# Static variable ensures that time is monotonicly increasing and is therefore
44-
# different for each block created => blockhash is unique.
45-
mine_large_blocks.nTime = min(mine_large_blocks.nTime, int(best_block["time"])) + 1
46-
except AttributeError:
47-
mine_large_blocks.nTime = int(best_block["time"]) + 1
48+
mine_large_blocks.nTime = max(mine_large_blocks.nTime, int(best_block["time"])) + 1
4849
previousblockhash = int(best_block["hash"], 16)
4950

5051
for _ in range(n):

test/functional/test_runner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
BASE_SCRIPTS = [
7070
# Scripts that are run by the travis build process.
7171
# Longest test should go first, to favor running tests in parallel
72+
'feature_pruning.py',
7273
'feature_fee_estimation.py',
7374
'wallet_hd.py',
7475
'wallet_backup.py',
@@ -199,7 +200,6 @@
199200
EXTENDED_SCRIPTS = [
200201
# These tests are not run by the travis build process.
201202
# Longest test should go first, to favor running tests in parallel
202-
'feature_pruning.py',
203203
'feature_dbcrash.py',
204204
]
205205

0 commit comments

Comments
 (0)