Fix intermittent test failure, reduce test time
In txn_clone.py, non-essential test transaction tx2 was asserted to be unconfirmed, but would occasionally confirm depending on network behavior. Fix by explicitly sharing with miner and checking for 1 confirmation. Reduce required conflict tests from 4 to 2, by moving one invocation each of txn_clone.py and txn_doublespend.py to the extented test section. This saves about 15 seconds per test run for me.
This commit is contained in:
parent
7fc25c2e5d
commit
8a0b933aae
2 changed files with 5 additions and 3 deletions
|
@ -19,10 +19,8 @@ testScripts=(
|
||||||
'wallet.py'
|
'wallet.py'
|
||||||
'listtransactions.py'
|
'listtransactions.py'
|
||||||
'mempool_resurrect_test.py'
|
'mempool_resurrect_test.py'
|
||||||
'txn_doublespend.py'
|
|
||||||
'txn_doublespend.py --mineblock'
|
'txn_doublespend.py --mineblock'
|
||||||
'txn_clone.py'
|
'txn_clone.py'
|
||||||
'txn_clone.py --mineblock'
|
|
||||||
'getchaintips.py'
|
'getchaintips.py'
|
||||||
'rawtransactions.py'
|
'rawtransactions.py'
|
||||||
'rest.py'
|
'rest.py'
|
||||||
|
@ -44,6 +42,8 @@ testScriptsExt=(
|
||||||
'bipdersig.py'
|
'bipdersig.py'
|
||||||
'getblocktemplate_longpoll.py'
|
'getblocktemplate_longpoll.py'
|
||||||
'getblocktemplate_proposals.py'
|
'getblocktemplate_proposals.py'
|
||||||
|
'txn_doublespend.py'
|
||||||
|
'txn_clone.py --mineblock'
|
||||||
'pruning.py'
|
'pruning.py'
|
||||||
'forknotify.py'
|
'forknotify.py'
|
||||||
'invalidateblock.py'
|
'invalidateblock.py'
|
||||||
|
|
|
@ -125,6 +125,8 @@ class TxnMallTest(BitcoinTestFramework):
|
||||||
|
|
||||||
# Reconnect the split network, and sync chain:
|
# Reconnect the split network, and sync chain:
|
||||||
connect_nodes(self.nodes[1], 2)
|
connect_nodes(self.nodes[1], 2)
|
||||||
|
self.nodes[2].sendrawtransaction(fund_bar_tx["hex"])
|
||||||
|
self.nodes[2].sendrawtransaction(tx2["hex"])
|
||||||
self.nodes[2].generate(1) # Mine another block to make sure we sync
|
self.nodes[2].generate(1) # Mine another block to make sure we sync
|
||||||
sync_blocks(self.nodes)
|
sync_blocks(self.nodes)
|
||||||
|
|
||||||
|
@ -136,7 +138,7 @@ class TxnMallTest(BitcoinTestFramework):
|
||||||
# Verify expected confirmations
|
# Verify expected confirmations
|
||||||
assert_equal(tx1["confirmations"], -1)
|
assert_equal(tx1["confirmations"], -1)
|
||||||
assert_equal(tx1_clone["confirmations"], 2)
|
assert_equal(tx1_clone["confirmations"], 2)
|
||||||
assert_equal(tx2["confirmations"], 0)
|
assert_equal(tx2["confirmations"], 1)
|
||||||
|
|
||||||
# Check node0's total balance; should be same as before the clone, + 100 BTC for 2 matured,
|
# Check node0's total balance; should be same as before the clone, + 100 BTC for 2 matured,
|
||||||
# less possible orphaned matured subsidy
|
# less possible orphaned matured subsidy
|
||||||
|
|
Loading…
Reference in a new issue