pytest: Use valgrind target suppressions instead of skipping tests

Having a list of very targeted suppressions allows us to still run the
majority of tests with valgrind checking, and not fail when Rust does
some trickery. This is for example the case with `std::sync::Once`
which uses `num_procs` calling out to the cgroups subsystem, sometimes
with a null path.

Suggested-by: Rusty Russell <@rustyrussell>
This commit is contained in:
Christian Decker
2022-02-09 17:10:09 +01:00
committed by Rusty Russell
parent a1555623bc
commit 4aba119733
4 changed files with 64 additions and 14 deletions

View File

@@ -5,19 +5,11 @@ import subprocess
import pytest
# Skip the entire module if we don't have Rust. The same is true for
# VALGRIND, since it sometimes causes false positives in
# `std::sync::Once`
pytestmark = [
pytest.mark.skipif(
env('RUST') != '1',
reason='RUST is not enabled skipping rust-dependent tests'
),
pytest.mark.skipif(
env('VALGRIND') == '1',
reason='VALGRIND is enabled skipping rust-dependent tests, as they may report false positives.'
),
]
# Skip the entire module if we don't have Rust.
pytestmark = pytest.mark.skipif(
env('RUST') != '1',
reason='RUST is not enabled skipping rust-dependent tests'
)
def test_rpc_client(node_factory):