test: Fix intermittent issue in wallet_bumpfee #19778

pull MarcoFalke wants to merge 2 commits into bitcoin:master from MarcoFalke:2008-testFix changing 1 files +53 −25
  1. MarcoFalke commented at 4:23 PM on August 21, 2020: member

    With a "dirty" mempool a transaction might fail to be accepted intermittently. For example,

    Fix the issue by clearing the mempool between subtests

  2. DrahtBot added the label Tests on Aug 21, 2020
  3. in test/functional/wallet_bumpfee.py:356 in fad6900b94 outdated
     357 | @@ -333,6 +358,7 @@ def test_maxtxfee_fails(self, rbf_node, dest_address):
     358 |      assert_raises_rpc_error(-4, "Unable to create transaction. Fee exceeds maximum configured by -maxtxfee", rbf_node.bumpfee, rbfid)
     359 |      self.restart_node(1, self.extra_args[1])
     360 |      rbf_node.walletpassphrase(WALLET_PASSPHRASE, WALLET_PASSPHRASE_TIMEOUT)
     361 | +    self.connect_nodes(1, 0)
     362 |  
    


    promag commented at 11:01 AM on August 24, 2020:

    I think I'd prefer to see clear_mempool() here, on each test end.


    MarcoFalke commented at 11:52 AM on August 24, 2020:

    thx, done

  4. promag commented at 11:01 AM on August 24, 2020: member

    ACK

  5. test: Select at least the fee in wallet_bumpfee to avoid negative amounts fa347b2f25
  6. test: Fix intermittent issue in wallet_bumpfee fafc9d5af4
  7. MarcoFalke force-pushed on Aug 24, 2020
  8. in test/functional/wallet_bumpfee.py:215 in fa347b2f25 outdated
     210 | @@ -211,14 +211,15 @@ def test_notmine_bumpfee_fails(self, rbf_node, peer_node, dest_address):
     211 |      # here, the rbftx has a peer_node coin and then adds a rbf_node input
     212 |      # Note that this test depends upon the RPC code checking input ownership prior to change outputs
     213 |      # (since it can't use fundrawtransaction, it lacks a proper change output)
     214 | -    utxos = [node.listunspent()[-1] for node in (rbf_node, peer_node)]
     215 | +    fee = Decimal("0.001")
     216 | +    utxos = [node.listunspent(query_options={'minimumAmount': fee})[-1] for node in (rbf_node, peer_node)]
    


    promag commented at 11:55 AM on August 24, 2020:

    fa347b2f2570a9436313a7c5d61015f2088662f4

    nit, maximumCount: 1.

  9. in test/functional/wallet_bumpfee.py:223 in fa347b2f25 outdated
     220 |          "address": utxo["address"],
     221 |          "sequence": BIP125_SEQUENCE_NUMBER
     222 |      } for utxo in utxos]
     223 | -    output_val = sum(utxo["amount"] for utxo in utxos) - Decimal("0.001")
     224 | +    output_val = sum(utxo["amount"] for utxo in utxos) - fee
     225 |      rawtx = rbf_node.createrawtransaction(inputs, {dest_address: output_val})
    


    promag commented at 11:57 AM on August 24, 2020:

    fa347b2f2570a9436313a7c5d61015f2088662f4

    nit also assert output_val > 0? utxo list "could" be empty.


    MarcoFalke commented at 12:03 PM on August 24, 2020:

    createrawtransaction asserts that the value is positive

  10. promag commented at 11:57 AM on August 24, 2020: member

    Code review ACK fafc9d5af48c987212af4170bb8b2504be8138f8.

  11. MarcoFalke commented at 5:24 PM on August 26, 2020: member
  12. MarcoFalke merged this on Aug 26, 2020
  13. MarcoFalke closed this on Aug 26, 2020

  14. sidhujag referenced this in commit 750fe3635f on Aug 26, 2020
  15. MarcoFalke deleted the branch on Aug 26, 2020
  16. DrahtBot locked this on Feb 15, 2022
Contributors
Labels

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-17 06:14 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me