Page MenuHomePhabricator

[backport#17633] tests: Add option --valgrind to run the functional tests under Valgrind
ClosedPublic

Authored by majcosta on Jul 29 2020, 18:08.

Details

Summary

Add option --valgrind to run nodes under valgrind in the functional tests (practicalswift)

Pull request description:

What is better than fixing bugs? Fixing entire bug classes of course! :)

Add option `--valgrind` to run the functional tests under Valgrind.

Regular functional testing under Valgrind would have caught many of the uninitialized reads we've seen historically.

Let's kill this bug class once and for all: let's never use an uninitialized value ever again. Or at least not one that would be triggered by running the functional tests! :)

My hope is that this addition will make it super-easy to run the functional tests under Valgrind and thus increase the probability of people making use of it :)

Hopefully `test/functional/test_runner.py --valgrind` will become a natural part of the pre-release QA process.

**Usage:**

```
$ test/functional/test_runner.py --help
…
  --valgrind            run nodes under the valgrind memory error detector:
                        expect at least a ~10x slowdown, valgrind 3.14 or
                        later required
```

https://github.com/bitcoin/bitcoin/pull/17633/commits/5db506ba5943868cc2c845f717508739b7f05714


Depends on D7083

Backport of Core PR17633

Test Plan

Have valgrind >3.14 installed

ninja
test_runner.py --valgrind

notice that tests run 10x slower

Event Timeline

[Bot Message]
One or more PR numbers were detected in the summary.
Links to those PRs have been inserted into the summary for reference.

This revision is now accepted and ready to land.Jul 29 2020, 21:18