Fix ListCoins test failure due to unset g_wallet_allow_fallback_fee #12582

pull ryanofsky wants to merge 1 commits into bitcoin:master from ryanofsky:pr/listg2 changing 4 files +1 −6
  1. ryanofsky commented at 8:02 pm on March 2, 2018: member

    New global variable was introduced in #11882 and not setting it causes:

    0wallet/test/wallet_tests.cpp(638): error in "ListCoins": check wallet->CreateTransaction({recipient}, wtx, reservekey, fee, changePos, error, dummy) failed
    1wallet/test/wallet_tests.cpp(679): error in "ListCoins": check list.begin()->second.size() == 2 failed [1 != 2]
    2wallet/test/wallet_tests.cpp(686): error in "ListCoins": check available.size() == 2 failed [1 != 2]
    3wallet/test/wallet_tests.cpp(705): error in "ListCoins": check list.begin()->second.size() == 2 failed [1 != 2]
    

    It’s possible to reproduce the failure reliably by running:

    0src/test/test_bitcoin --log_level=test_suite --run_test=wallet_tests/ListCoins
    

    Failures happen nondeterministically because boost test framework doesn’t run tests in a specified order, and tests that run previously can set the global variables and mask the bug.

    This is similar to bugs #12150 and #12424. Example travis failures are:

    https://travis-ci.org/bitcoin/bitcoin/jobs/348296805#L2676 https://travis-ci.org/bitcoin/bitcoin/jobs/348362560#L2769 https://travis-ci.org/bitcoin/bitcoin/jobs/348362563#L2824

  2. Fix ListCoins test failure due to unset g_wallet_allow_fallback_fee
    New global variables were introduced in #11882 and not setting them causes:
    
        wallet/test/wallet_tests.cpp(638): error in "ListCoins": check wallet->CreateTransaction({recipient}, wtx, reservekey, fee, changePos, error, dummy) failed
        wallet/test/wallet_tests.cpp(679): error in "ListCoins": check list.begin()->second.size() == 2 failed [1 != 2]
        wallet/test/wallet_tests.cpp(686): error in "ListCoins": check available.size() == 2 failed [1 != 2]
        wallet/test/wallet_tests.cpp(705): error in "ListCoins": check list.begin()->second.size() == 2 failed [1 != 2]
    
    It's possible to reproduce the failure reliably by running:
    
        src/test/test_bitcoin --log_level=test_suite --run_test=wallet_tests/ListCoins
    
    Failures happen nondeterministically because boost test framework doesn't run
    tests in a specified order, and tests that run previously can set the global
    variables and mask the bug.
    7ba2d57852
  3. fanquake commented at 4:40 am on March 3, 2018: member

    Using 90a0aed51194ad82da8e011b96f9561c685e40b7 and

    0src/test/test_bitcoin --log_level=test_suite --run_test=wallet_tests/ListCoins
    

    results in the 4 failures every time.

    0wallet/test/wallet_tests.cpp:657: Entering test case "ListCoins"
    1wallet/test/wallet_tests.cpp:638: error: in "wallet_tests/ListCoins": check wallet->CreateTransaction({recipient}, wtx, reservekey, fee, changePos, error, dummy) has failed
    2wallet/test/wallet_tests.cpp:679: error: in "wallet_tests/ListCoins": check list.begin()->second.size() == 2 has failed [1 != 2]
    3wallet/test/wallet_tests.cpp:686: error: in "wallet_tests/ListCoins": check available.size() == 2 has failed [1 != 2]
    4wallet/test/wallet_tests.cpp:705: error: in "wallet_tests/ListCoins": check list.begin()->second.size() == 2 has failed [1 != 2]
    5wallet/test/wallet_tests.cpp:657: Leaving test case "ListCoins"; testing time: 396433us
    6wallet/test/wallet_tests.cpp:37: Leaving test suite "wallet_tests"; testing time: 396476us
    7Leaving test module "Bitcoin Test Suite"; testing time: 396555us
    8*** 4 failures are detected in the test module "Bitcoin Test Suite"
    

    tACK 7ba2d57

    0Running 1 test case...
    1Entering test module "Bitcoin Test Suite"
    2wallet/test/wallet_tests.cpp:37: Entering test suite "wallet_tests"
    3wallet/test/wallet_tests.cpp:657: Entering test case "ListCoins"
    4wallet/test/wallet_tests.cpp:657: Leaving test case "ListCoins"; testing time: 393380us
    5wallet/test/wallet_tests.cpp:37: Leaving test suite "wallet_tests"; testing time: 393434us
    6Leaving test module "Bitcoin Test Suite"; testing time: 393513us
    7
    8*** No errors detected
    
  4. fanquake added the label Tests on Mar 3, 2018
  5. MarcoFalke commented at 3:27 pm on March 3, 2018: member
    utACK 7ba2d5785251c90c5fea134917a4f53a3f632b9a. Looks like a quick fix for the tests
  6. MarcoFalke merged this on Mar 3, 2018
  7. MarcoFalke closed this on Mar 3, 2018

  8. MarcoFalke referenced this in commit 6012f1caf7 on Mar 3, 2018
  9. jonasschnelli commented at 5:56 am on March 4, 2018: contributor
    Sorry for missing that. Thanks for fixing. Post merge utACK.
  10. DrahtBot locked this on Sep 8, 2021

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: 2024-10-05 01:12 UTC

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