Commit graph

19 commits

Author SHA1 Message Date
Fabian Jahr
43e7d576f5 doc: Improve test READMEs 2019-09-26 19:04:58 +02:00
Jon Atack
e142ee03e7
doc: describe how to pass wildcard names to test runner 2019-07-15 10:14:23 +02:00
MarcoFalke
e91f0a7af2 doc: Remove travis badge from readme 2019-06-19 11:39:27 -04:00
MarcoFalke
5029e94f85
Merge #14519: tests: add utility to easily profile node performance with perf
13782b8ba8 docs: add perf section to developer docs (James O'Beirne)
58180b5fd4 tests: add utility to easily profile node performance with perf (James O'Beirne)

Pull request description:

  Adds a context manager to easily (and selectively) profile node performance during functional test execution using `perf`.

  While writing some tests, I encountered some odd bitcoind slowness. I wrote up a utility (`TestNode.profile_with_perf`) that generates performance diagnostics for a node by running `perf` during the execution of a particular region of test code.

  `perf` usage is detailed in the excellent (and sadly unmerged) https://github.com/bitcoin/bitcoin/pull/12649; all due props to @eklitzke.

  ### Example

  ```python
  with node.profile_with_perf("large-msgs"):
      for i in range(200):
          node.p2p.send_message(some_large_msg)
      node.p2p.sync_with_ping()
  ```

  This generates a perf data file in the test node's datadir (`/tmp/testtxmpod0y/node0/node-0-TestName-large-msgs.perf.data`).

  Running `perf report` generates nice output about where the node spent most of its time while running that part of the test:

  ```bash
  $ perf report -i /tmp/testtxmpod0y/node0/node-0-TestName-large-msgs.perf.data --stdio \
    | c++filt \
    | less

  # To display the perf.data header info, please use --header/--header-only options.
  #
  #
  # Total Lost Samples: 0
  #
  # Samples: 135  of event 'cycles:pp'
  # Event count (approx.): 1458205679493582
  #
  # Children      Self  Command          Shared Object        Symbol
  # ........  ........  ...............  ...................  ........................................................................................................................................................................................................................................................................
  #
      70.14%     0.00%  bitcoin-net      bitcoind             [.] CNode::ReceiveMsgBytes(char const*, unsigned int, bool&)
                  |
                  ---CNode::ReceiveMsgBytes(char const*, unsigned int, bool&)

      70.14%     0.00%  bitcoin-net      bitcoind             [.] CNetMessage::readData(char const*, unsigned int)
                  |
                  ---CNetMessage::readData(char const*, unsigned int)
                     CNode::ReceiveMsgBytes(char const*, unsigned int, bool&)

      35.52%     0.00%  bitcoin-net      bitcoind             [.] std::vector<char, zero_after_free_allocator<char> >::_M_fill_insert(__gnu_cxx::__normal_iterator<char*, std::vector<char, zero_after_free_allocator<char> > >, unsigned long, char const&)
                  |
                  ---std::vector<char, zero_after_free_allocator<char> >::_M_fill_insert(__gnu_cxx::__normal_iterator<char*, std::vector<char, zero_after_free_allocator<char> > >, unsigned long, char const&)
                     CNetMessage::readData(char const*, unsigned int)
                     CNode::ReceiveMsgBytes(char const*, unsigned int, bool&)

  ...
  ```

Tree-SHA512: 9ac4ceaa88818d5eca00994e8e3c8ad42ae019550d6583972a0a4f7b0c4f61032e3d0c476b4ae58756bc5eb8f8015a19a7fc26c095bd588f31d49a37ed0c6b3e
2019-02-05 17:40:16 -05:00
Gregory Sanders
f96dbd1bbe gdb attaching to process during tests has non-sudo solution 2019-01-31 12:25:04 +00:00
James O'Beirne
58180b5fd4 tests: add utility to easily profile node performance with perf
Introduces `TestNode.profile_with_perf()` context manager which
samples node execution to produce profiling data.

Also introduces a test framework flag, `--perf`, which will run
perf on all nodes for the duration of a given test.
2019-01-22 08:55:55 -05:00
benthecarman
ef5ebc6d8f
docs: Clarifying testing instructions 2019-01-09 11:10:12 -06:00
Mason Simon
8640631ebc
docs: Document lint tests 2018-10-20 13:09:05 +08:00
João Barbosa
12dd101345 scripted-diff: Remove trailing whitespaces
-BEGIN VERIFY SCRIPT-

sed --in-place'' --regexp-extended 's/[[:space:]]+$//g' $(git grep -I --files-with-matches --extended-regexp '[[:space:]]+$' -- src test  ':!*.svg' ':!src/crypto/sha256_sse4*' ':!src/leveldb' ':!src/qt/locale' ':!src/secp256k1' ':!src/univalue')

-END VERIFY SCRIPT-
2018-07-24 20:46:23 +01:00
Conor Scott
8a6c62be63 [tests] Update README after filename change 2018-02-06 17:57:32 +04:00
fanquake
bf1897710f
[trivial][docs] Fix incorrect link in /test/ README.md 2018-01-22 18:52:55 +08:00
Gregory Sanders
7ec3343df2 add gdb attach process to test README 2017-06-27 13:02:55 -04:00
John Newbery
76859e6a76 [tests] Update functional tests documentation 2017-06-27 05:04:52 -04:00
MarcoFalke
fac79e4d18 qa: Warn when specified test is not found 2017-05-14 12:39:02 +02:00
Jimmy Song
637706dc9e Tests: Put Extended tests first when they're included
* Added documentation in tests/README.md about enabling wallet, utils and daemon.
* Change ordering to make the long-running EXTENDED_TESTS go first.
2017-04-17 15:20:35 -07:00
John Newbery
63d66ba20a Move src/test/bitcoin-util-test.py to test/util/bitcoin-util-test.py 2017-03-20 10:40:31 -04:00
John Newbery
a9bd622a65 Rename test/pull-tester/rpc-tests.py to test/functional/test_runner.py 2017-03-20 10:40:31 -04:00
John Newbery
c28ee91db0 Rename rpc-tests directory to functional 2017-03-20 10:40:31 -04:00
John Newbery
00902c48cd Rename qa directory to test 2017-03-20 10:40:31 -04:00
Renamed from qa/README.md (Browse further)