Skip to content

Conversation

@ryanofsky
Copy link
Contributor

@ryanofsky ryanofsky commented Mar 2, 2018

New global variable was introduced in #11882 and not setting it 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.

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

New global variables were introduced in bitcoin#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.
@fanquake
Copy link
Member

fanquake commented Mar 3, 2018

Using 90a0aed and

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

results in the 4 failures every time.

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

tACK 7ba2d57

Running 1 test case...
Entering test module "Bitcoin Test Suite"
wallet/test/wallet_tests.cpp:37: Entering test suite "wallet_tests"
wallet/test/wallet_tests.cpp:657: Entering test case "ListCoins"
wallet/test/wallet_tests.cpp:657: Leaving test case "ListCoins"; testing time: 393380us
wallet/test/wallet_tests.cpp:37: Leaving test suite "wallet_tests"; testing time: 393434us
Leaving test module "Bitcoin Test Suite"; testing time: 393513us

*** No errors detected

@fanquake fanquake added the Tests label Mar 3, 2018
@maflcko
Copy link
Member

maflcko commented Mar 3, 2018

utACK 7ba2d57. Looks like a quick fix for the tests

@maflcko maflcko merged commit 7ba2d57 into bitcoin:master Mar 3, 2018
maflcko pushed a commit that referenced this pull request Mar 3, 2018
…fallback_fee

7ba2d57 Fix ListCoins test failure due to unset g_wallet_allow_fallback_fee (Russell Yanofsky)

Pull request description:

  New global variable was introduced in #11882 and not setting it 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.

  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

Tree-SHA512: ca37b554a75c12ac2d534de62bf74eb9e0b29e4399ebf1fa10053a40887e55e9e7135f754a01e5a67499cc8677ae226542146b370b1e83d08bb63d79ff379073
@jonasschnelli
Copy link
Contributor

Sorry for missing that. Thanks for fixing.
Post merge utACK.

@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants