doc: Improve test READMEs

This commit is contained in:
Fabian Jahr
2019-09-24 14:42:18 +02:00
parent 3ce8298888
commit 43e7d576f5
2 changed files with 50 additions and 18 deletions

View File

@@ -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>
```