mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 05:57:59 +01:00
doc: Improve test READMEs
This commit is contained in:
@@ -136,8 +136,10 @@ killall bitcoind
|
||||
|
||||
##### Test logging
|
||||
|
||||
The tests contain logging at different levels (debug, info, warning, etc). By
|
||||
default:
|
||||
The tests contain logging at five different levels (DEBUG, INFO, WARNING, ERROR
|
||||
and CRITICAL). From within your functional tests you can log to these different
|
||||
levels using the logger included in the test_framework, e.g.
|
||||
`self.log.debug(object)`. By default:
|
||||
|
||||
- when run through the test_runner harness, *all* logs are written to
|
||||
`test_framework.log` and no logs are output to the console.
|
||||
@@ -182,18 +184,32 @@ call methods that interact with the bitcoind nodes-under-test.
|
||||
If further introspection of the bitcoind instances themselves becomes
|
||||
necessary, this can be accomplished by first setting a pdb breakpoint
|
||||
at an appropriate location, running the test to that point, then using
|
||||
`gdb` to attach to the process and debug.
|
||||
`gdb` (or `lldb` on macOS) to attach to the process and debug.
|
||||
|
||||
For instance, to attach to `self.node[1]` during a run:
|
||||
For instance, to attach to `self.node[1]` during a run you can get
|
||||
the pid of the node within `pdb`.
|
||||
|
||||
```
|
||||
(pdb) self.node[1].process.pid
|
||||
```
|
||||
|
||||
Alternatively, you can find the pid by inspecting the temp folder for the specific test
|
||||
you are running. The path to that folder is printed at the beginning of every
|
||||
test run:
|
||||
|
||||
```bash
|
||||
2017-06-27 14:13:56.686000 TestFramework (INFO): Initializing test directory /tmp/user/1000/testo9vsdjo3
|
||||
```
|
||||
|
||||
use the directory path to get the pid from the pid file:
|
||||
Use the path to find the pid file in the temp folder:
|
||||
|
||||
```bash
|
||||
cat /tmp/user/1000/testo9vsdjo3/node1/regtest/bitcoind.pid
|
||||
```
|
||||
|
||||
Then you can use the pid to start `gdb`:
|
||||
|
||||
```bash
|
||||
gdb /home/example/bitcoind <pid>
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user