aboutsummaryrefslogtreecommitdiff
path: root/test/functional
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2023-04-17 16:19:40 +0100
committerfanquake <fanquake@gmail.com>2023-04-17 16:31:31 +0100
commit54e07a05b28d2bca8fc08cca0bf6e7ddf6762488 (patch)
tree8fb25d4e7cbfc0bea3eee03d7d28b40e88008c26 /test/functional
parent5d9d6f7fbc9fa010d7b55d09059e376c9faf9b81 (diff)
parente07dd5fff9eb64d7615ab515b351e296c00b1861 (diff)
downloadbitcoin-54e07a05b28d2bca8fc08cca0bf6e7ddf6762488.tar.xz
Merge bitcoin/bitcoin#27471: test: fix bumpfee 'spend_one_input' occasional failure
e07dd5fff9eb64d7615ab515b351e296c00b1861 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 e07dd5fff9eb64d7615ab515b351e296c00b1861 pablomartin4btc: ACK https://github.com/bitcoin/bitcoin/commit/e07dd5fff9eb64d7615ab515b351e296c00b1861. Tree-SHA512: c150ed6fcfbb6f1502eaf6370a57aae0da991c0fc48e8bb3d446805f4336abba5d80ff0de26094914da95432dd0255030fe527001af4510dfdcefbc7230f14d6
Diffstat (limited to 'test/functional')
-rwxr-xr-xtest/functional/wallet_bumpfee.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/test/functional/wallet_bumpfee.py b/test/functional/wallet_bumpfee.py
index 4f7af328c1..2260af1d57 100755
--- a/test/functional/wallet_bumpfee.py
+++ b/test/functional/wallet_bumpfee.py
@@ -101,11 +101,13 @@ class BumpFeeTest(BitcoinTestFramework):
test_change_script_match(self, rbf_node, dest_address)
test_settxfee(self, rbf_node, dest_address)
test_maxtxfee_fails(self, rbf_node, dest_address)
- test_feerate_checks_replaced_outputs(self, rbf_node)
# These tests wipe out a number of utxos that are expected in other tests
test_small_output_with_feerate_succeeds(self, rbf_node, dest_address)
test_no_more_inputs_fails(self, rbf_node, dest_address)
+ # Context independent tests
+ test_feerate_checks_replaced_outputs(self, rbf_node, peer_node)
+
def test_invalid_parameters(self, rbf_node, peer_node, dest_address):
self.log.info('Test invalid parameters')
rbfid = spend_one_input(rbf_node, dest_address)
@@ -670,7 +672,11 @@ def test_no_more_inputs_fails(self, rbf_node, dest_address):
self.clear_mempool()
-def test_feerate_checks_replaced_outputs(self, rbf_node):
+def test_feerate_checks_replaced_outputs(self, rbf_node, peer_node):
+ # Make sure there is enough balance
+ peer_node.sendtoaddress(rbf_node.getnewaddress(), 60)
+ self.generate(peer_node, 1)
+
self.log.info("Test that feerate checks use replaced outputs")
outputs = []
for i in range(50):
@@ -693,6 +699,7 @@ def test_feerate_checks_replaced_outputs(self, rbf_node):
# Bumpfee and replace all outputs with a single one using the minimum feerate
rbf_node.bumpfee(tx_res["txid"], {"fee_rate": min_fee_rate, "outputs": new_outputs})
+ self.clear_mempool()
if __name__ == "__main__":