Page MenuHomePhabricator

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

Authored by majcosta on Wed, Jul 29, 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

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

majcosta created this revision.Wed, Jul 29, 18:08
Herald added a reviewer: Restricted Project. · View Herald TranscriptWed, Jul 29, 18:08
majcosta requested review of this revision.Wed, Jul 29, 18:08
teamcity edited the summary of this revision. (Show Details)Wed, Jul 29, 18:08

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

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