test: Fix intermitent failure in wallet_basic.py #23141

pull meshcollider wants to merge 1 commits into bitcoin:master from meshcollider:202109_fix_test_rounding changing 1 files +1 −1
  1. meshcollider commented at 12:04 AM on September 30, 2021: contributor

    assert_fee_amount currently uses round() when calculating the fee rate, which causes intermittent failure in wallet_basic.py: https://cirrus-ci.com/task/5721255786577920?logs=ci#L145

    2021-09-29T23:28:41.198000Z TestFramework (INFO): Test sendtoaddress with fee_rate param (explicit fee rate in sat/vB)
    2021-09-29T23:28:49.992000Z TestFramework (ERROR): Assertion failed
    Traceback (most recent call last):
      File "/tmp/cirrus-ci-build/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/test_framework/test_framework.py", line 131, in main
        self.run_test()
      File "/tmp/cirrus-ci-build/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/wallet_basic.py", line 500, in run_test
        assert_fee_amount(fee, tx_size, Decimal(fee_rate_btc_kvb))
      File "/tmp/cirrus-ci-build/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/test_framework/util.py", line 41, in assert_fee_amount
        raise AssertionError("Fee of %s BTC too low! (Should be %s BTC)" % (str(fee), str(target_fee)))
    AssertionError: Fee of 0.00000255 BTC too low! (Should be 0.00000256 BTC)
    

    We should truncate rather than rounding.

    This would also be fixed by #22949 but it makes more sense to make the test consistent with the current code.

  2. Fix intermitent failure in wallet_basic.py 56a0e8014a
  3. meshcollider added the label Tests on Sep 30, 2021
  4. meshcollider added the label TX fees and policy on Sep 30, 2021
  5. MarcoFalke renamed this:
    Fix intermitent failure in wallet_basic.py
    test: Fix intermitent failure in wallet_basic.py
    on Sep 30, 2021
  6. MarcoFalke removed the label TX fees and policy on Sep 30, 2021
  7. jonatack commented at 6:20 AM on September 30, 2021: member

    See #23136.

  8. DrahtBot commented at 2:31 PM on September 30, 2021: member

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #23136 (test: update fee rate assertion helper in the functional test framework by jonatack)
    • #22364 (wallet: Make a tr() descriptor by default by achow101)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  9. meshcollider commented at 9:33 PM on September 30, 2021: contributor
  10. meshcollider closed this on Sep 30, 2021

  11. DrahtBot locked this on Oct 30, 2022

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-13 15:14 UTC

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