Skip to content

Commit 54e07a0

Browse files
committed
Merge bitcoin/bitcoin#27471: test: fix bumpfee 'spend_one_input' occasional failure
e07dd5f test: fix bumpfee 'spend_one_input' occasional failure (furszy) Pull request description: CI test failure, in master: https://cirrus-ci.com/task/5975232842825728. In #27469 https://cirrus-ci.com/task/6452468402356224 Most of the subtests in `wallet_bumpfee.py` expect to find spendable UTXOs of 0.001 btc in the rbf wallet. They use the `spend_one_input()` method which fails if none of them exist. The sporadic failure comes from the recently added `test_feerate_checks_replaced_outputs` subtest that can spend all them. Leaving the next subtests with no 0.001 UTXOs to spend. To solve it, this PR moves the recently added case into a "context independent subtests" section. Which is placed at the end to not affect other cases. ACKs for top commit: achow101: ACK e07dd5f pablomartin4btc: ACK bitcoin/bitcoin@e07dd5f. Tree-SHA512: c150ed6fcfbb6f1502eaf6370a57aae0da991c0fc48e8bb3d446805f4336abba5d80ff0de26094914da95432dd0255030fe527001af4510dfdcefbc7230f14d6
2 parents 5d9d6f7 + e07dd5f commit 54e07a0

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

test/functional/wallet_bumpfee.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,13 @@ def run_test(self):
101101
test_change_script_match(self, rbf_node, dest_address)
102102
test_settxfee(self, rbf_node, dest_address)
103103
test_maxtxfee_fails(self, rbf_node, dest_address)
104-
test_feerate_checks_replaced_outputs(self, rbf_node)
105104
# These tests wipe out a number of utxos that are expected in other tests
106105
test_small_output_with_feerate_succeeds(self, rbf_node, dest_address)
107106
test_no_more_inputs_fails(self, rbf_node, dest_address)
108107

108+
# Context independent tests
109+
test_feerate_checks_replaced_outputs(self, rbf_node, peer_node)
110+
109111
def test_invalid_parameters(self, rbf_node, peer_node, dest_address):
110112
self.log.info('Test invalid parameters')
111113
rbfid = spend_one_input(rbf_node, dest_address)
@@ -670,7 +672,11 @@ def test_no_more_inputs_fails(self, rbf_node, dest_address):
670672
self.clear_mempool()
671673

672674

673-
def test_feerate_checks_replaced_outputs(self, rbf_node):
675+
def test_feerate_checks_replaced_outputs(self, rbf_node, peer_node):
676+
# Make sure there is enough balance
677+
peer_node.sendtoaddress(rbf_node.getnewaddress(), 60)
678+
self.generate(peer_node, 1)
679+
674680
self.log.info("Test that feerate checks use replaced outputs")
675681
outputs = []
676682
for i in range(50):
@@ -693,6 +699,7 @@ def test_feerate_checks_replaced_outputs(self, rbf_node):
693699

694700
# Bumpfee and replace all outputs with a single one using the minimum feerate
695701
rbf_node.bumpfee(tx_res["txid"], {"fee_rate": min_fee_rate, "outputs": new_outputs})
702+
self.clear_mempool()
696703

697704

698705
if __name__ == "__main__":

0 commit comments

Comments
 (0)