Skip to content

Conversation

maflcko
Copy link
Member

@maflcko maflcko commented Feb 20, 2020

Closes #16700

Can be tested by adding an assert(0) and then running either make check or ./src/test/test_bitcoin -t bla_tests --catch_system_errors=no/yes

@practicalswift
Copy link
Contributor

ACK fac52da

@Empact
Copy link
Contributor

Empact commented Feb 21, 2020

Tested ACK fac52da

Before:
Hangs until ^C:

Running tests: bip32_tests from test/bip32_tests.cpp
Running tests: coinselector_tests from wallet/test/coinselector_tests.cpp
Running tests: init_tests from wallet/test/init_tests.cpp
Running tests: ismine_tests from wallet/test/ismine_tests.cpp
Running tests: scriptpubkeyman_tests from wallet/test/scriptpubkeyman_tests.cpp
^Cmake[3]: *** [test/bip32_tests.cpp.test] Interrupt: 2
make[2]: *** [check-am] Interrupt: 2
make[1]: *** [check-recursive] Interrupt: 2
make: *** [check-recursive] Interrupt: 2

After:

Entering test module "Bitcoin Core Test Suite"
test/bip32_tests.cpp:125: Entering test suite "bip32_tests"
test/bip32_tests.cpp:127: Entering test case "bip32_test1"
2020-02-21T20:35:52Z Seed: Setting random seed for current tests to RANDOM_CTX_SEED=5a95da1e08216910a312eaf42a405485103a7e3e8128995bc2eb93fdff142ca5
2020-02-21T20:35:52Z Bitcoin Core version v0.19.99.0-fac52dafa-dirty (release build)
2020-02-21T20:35:52Z Using 16 MiB out of 32/2 requested for signature cache, able to store 524288 elements
2020-02-21T20:35:52Z Using 16 MiB out of 32/2 requested for script execution cache, able to store 524288 elements
Assertion failed: (0), function RunTest, file test/bip32_tests.cpp, line 105.
make[3]: *** [test/bip32_tests.cpp.test] Error 1
make[3]: *** Waiting for unfinished jobs....

@maflcko maflcko merged commit 36e5072 into bitcoin:master Feb 21, 2020
@maflcko maflcko deleted the 2002-testNoCatchSystemErrors branch February 21, 2020 23:07
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Feb 22, 2020
…ests

fac52da test: Set catch_system_errors=no on boost unit tests (MarcoFalke)

Pull request description:

  Closes bitcoin#16700

  Can be tested by adding an `assert(0)` and then running either `make check` or `./src/test/test_bitcoin -t bla_tests --catch_system_errors=no/yes`

ACKs for top commit:
  practicalswift:
    ACK fac52da
  Empact:
    Tested ACK bitcoin@fac52da

Tree-SHA512: ec00636951b2c1137aaf43610739d78d16f823f7da76a726d47f93b8b089766fb66b21504b3c5413bcf8b6b5c3db0ad74027d677db24a44487d6d79a6bdee2e0
deadalnix pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Oct 21, 2020
Summary:
Boost does not handle asserts well in unit tests. Encountering one causes
test_bitcoin to hang indefinitely. This may explain the occassional timeouts we're
experiencing in CI.

See https://www.boost.org/doc/libs/1_68_0/libs/test/doc/html/boost_test/utf_reference/rt_param_reference/catch_system.html

Backport of Core [[bitcoin/bitcoin#18183 | PR18183]]

Test Plan:
Introduce `assert(0);` into a unit test, then: `ninja check`
Pre-patch, `ninja check` hangs until killed (Ctrl+C).
Post-patch, `ninja check` errors out as expected.

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D8014
deadalnix pushed a commit to Bitcoin-ABC/secp256k1 that referenced this pull request Oct 22, 2020
Summary:
Boost does not handle asserts well in unit tests. Encountering one causes
test_bitcoin to hang indefinitely. This may explain the occassional timeouts we're
experiencing in CI.

See https://www.boost.org/doc/libs/1_68_0/libs/test/doc/html/boost_test/utf_reference/rt_param_reference/catch_system.html

Backport of Core [[bitcoin/bitcoin#18183 | PR18183]]

Test Plan:
Introduce `assert(0);` into a unit test, then: `ninja check`
Pre-patch, `ninja check` hangs until killed (Ctrl+C).
Post-patch, `ninja check` errors out as expected.

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D8014
sidhujag pushed a commit to syscoin-core/syscoin that referenced this pull request Nov 10, 2020
…ests

fac52da test: Set catch_system_errors=no on boost unit tests (MarcoFalke)

Pull request description:

  Closes bitcoin#16700

  Can be tested by adding an `assert(0)` and then running either `make check` or `./src/test/test_bitcoin -t bla_tests --catch_system_errors=no/yes`

ACKs for top commit:
  practicalswift:
    ACK fac52da
  Empact:
    Tested ACK bitcoin@fac52da

Tree-SHA512: ec00636951b2c1137aaf43610739d78d16f823f7da76a726d47f93b8b089766fb66b21504b3c5413bcf8b6b5c3db0ad74027d677db24a44487d6d79a6bdee2e0
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jun 27, 2021
…ests

fac52da test: Set catch_system_errors=no on boost unit tests (MarcoFalke)

Pull request description:

  Closes bitcoin#16700

  Can be tested by adding an `assert(0)` and then running either `make check` or `./src/test/test_bitcoin -t bla_tests --catch_system_errors=no/yes`

ACKs for top commit:
  practicalswift:
    ACK fac52da
  Empact:
    Tested ACK bitcoin@fac52da

Tree-SHA512: ec00636951b2c1137aaf43610739d78d16f823f7da76a726d47f93b8b089766fb66b21504b3c5413bcf8b6b5c3db0ad74027d677db24a44487d6d79a6bdee2e0
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jun 28, 2021
…ests

fac52da test: Set catch_system_errors=no on boost unit tests (MarcoFalke)

Pull request description:

  Closes bitcoin#16700

  Can be tested by adding an `assert(0)` and then running either `make check` or `./src/test/test_bitcoin -t bla_tests --catch_system_errors=no/yes`

ACKs for top commit:
  practicalswift:
    ACK fac52da
  Empact:
    Tested ACK bitcoin@fac52da

Tree-SHA512: ec00636951b2c1137aaf43610739d78d16f823f7da76a726d47f93b8b089766fb66b21504b3c5413bcf8b6b5c3db0ad74027d677db24a44487d6d79a6bdee2e0
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jun 29, 2021
…ests

fac52da test: Set catch_system_errors=no on boost unit tests (MarcoFalke)

Pull request description:

  Closes bitcoin#16700

  Can be tested by adding an `assert(0)` and then running either `make check` or `./src/test/test_bitcoin -t bla_tests --catch_system_errors=no/yes`

ACKs for top commit:
  practicalswift:
    ACK fac52da
  Empact:
    Tested ACK bitcoin@fac52da

Tree-SHA512: ec00636951b2c1137aaf43610739d78d16f823f7da76a726d47f93b8b089766fb66b21504b3c5413bcf8b6b5c3db0ad74027d677db24a44487d6d79a6bdee2e0
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jul 1, 2021
…ests

fac52da test: Set catch_system_errors=no on boost unit tests (MarcoFalke)

Pull request description:

  Closes bitcoin#16700

  Can be tested by adding an `assert(0)` and then running either `make check` or `./src/test/test_bitcoin -t bla_tests --catch_system_errors=no/yes`

ACKs for top commit:
  practicalswift:
    ACK fac52da
  Empact:
    Tested ACK bitcoin@fac52da

Tree-SHA512: ec00636951b2c1137aaf43610739d78d16f823f7da76a726d47f93b8b089766fb66b21504b3c5413bcf8b6b5c3db0ad74027d677db24a44487d6d79a6bdee2e0
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jul 1, 2021
…ests

fac52da test: Set catch_system_errors=no on boost unit tests (MarcoFalke)

Pull request description:

  Closes bitcoin#16700

  Can be tested by adding an `assert(0)` and then running either `make check` or `./src/test/test_bitcoin -t bla_tests --catch_system_errors=no/yes`

ACKs for top commit:
  practicalswift:
    ACK fac52da
  Empact:
    Tested ACK bitcoin@fac52da

Tree-SHA512: ec00636951b2c1137aaf43610739d78d16f823f7da76a726d47f93b8b089766fb66b21504b3c5413bcf8b6b5c3db0ad74027d677db24a44487d6d79a6bdee2e0
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jul 14, 2021
…ests

fac52da test: Set catch_system_errors=no on boost unit tests (MarcoFalke)

Pull request description:

  Closes bitcoin#16700

  Can be tested by adding an `assert(0)` and then running either `make check` or `./src/test/test_bitcoin -t bla_tests --catch_system_errors=no/yes`

ACKs for top commit:
  practicalswift:
    ACK fac52da
  Empact:
    Tested ACK bitcoin@fac52da

Tree-SHA512: ec00636951b2c1137aaf43610739d78d16f823f7da76a726d47f93b8b089766fb66b21504b3c5413bcf8b6b5c3db0ad74027d677db24a44487d6d79a6bdee2e0
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Feb 15, 2022
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.

test: boost unit tests don't handle assert very well
3 participants