Skip to content

Conversation

@maflcko
Copy link
Member

@maflcko maflcko commented May 20, 2020

Generally the unit tests are single threaded, with the exception of the script check threads, the schedule, and optionally indexer threads.

Like the functional tests, the thread name can serve additional debug information, so set -logthreadnames in unit tests.

Can be tested with

./src/test/test_bitcoin -l test_suite -t validation_tests/test_combiner_all -- DEBUG_LOG_OUT

@jamesob
Copy link
Contributor

jamesob commented May 20, 2020

Concept ACK

At some point we may just consider enabling threadnames by default; I don't think there's any noticeable performance penalty, but I can bench to verify.

@maflcko maflcko force-pushed the 2005-testThreadNames branch from fa0f6ab to fa2104c Compare May 20, 2020 16:32
@DrahtBot DrahtBot added the Tests label May 20, 2020
@DrahtBot
Copy link
Contributor

DrahtBot commented May 20, 2020

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

Conflicts

Reviewers, this pull request conflicts with the following ones:

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.

@laanwj
Copy link
Member

laanwj commented Jul 1, 2020

I'm not convinced on enabling logging of thread names by default, though more convenient during development, I think it increases the size of the log entries and files for something not useful for most users. But for the tests it makes a lot of sense.
Also the unifying of how to create the scheduler thread makes sense. Though we need to move away from the boost thread group at some point.
ACK 9999348

@laanwj laanwj merged commit e1b20e2 into bitcoin:master Jul 1, 2020
@maflcko maflcko deleted the 2005-testThreadNames branch July 1, 2020 20:37
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Jul 8, 2020
9999348 test: Set -logthreadnames in unit tests (MarcoFalke)
fa4ea99 init: Setup scheduler in tests and init in exactly the same way (MarcoFalke)

Pull request description:

  Generally the unit tests are single threaded, with the exception of the script check threads, the schedule, and optionally indexer threads.

  Like the functional tests, the thread name can serve additional debug information, so set `-logthreadnames` in unit tests.

  Can be tested with

  ```
  ./src/test/test_bitcoin -l test_suite -t validation_tests/test_combiner_all -- DEBUG_LOG_OUT

ACKs for top commit:
  laanwj:
    ACK 9999348

Tree-SHA512: 3bdbfc211da146da64b50b0826246aff5c611a84b69ab896a55b3c9d1adc92c5975da36ab92aee577df82e229c4326b477f4105bfdd1a5df4c9a0b018cf61602
Fabcien pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Feb 4, 2022
Summary:
This is a partial backport of [[bitcoin/bitcoin#19028 | core#19028]]
bitcoin/bitcoin@fa4ea99

This is backported as a minor dependency of [[bitcoin/bitcoin#21016 | core#21016]]

Test Plan:
With clang and debug:
`ninja all check-all`

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D10991
@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.

4 participants