From fa9cf81d39e1354e4239933a053f6c91a6727fec Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Wed, 25 Feb 2026 14:36:10 +0100 Subject: [PATCH] test: Add missing resolve() to valgrind.supp file Normally, when a symlinked test script is executed directly (e.g., `./bld-cmake/test/functional/wallet_disable.py`), Python's default behavior is to resolve the symlink of the script itself, setting `sys.path[0]` to the directory containing the physical source file. Consequently, the test framework util.py is imported from the source tree, and `Path(__file__).parents[3]` correctly resolves to the source root. However, `feature_framework_testshell.py` is unique because it manually inserts `Path(__file__).parent` into `sys.path`. That refers to the build tree and when importing the test framework util.py, the `Path(__file__).parents[3]` will incorrectly point to the build directory instead of the source root. Use `.resolve()` to ensure the Valgrind suppressions file path is always calculated relative to the physical source file, regardless of how the framework was imported. --- test/functional/test_framework/util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/functional/test_framework/util.py b/test/functional/test_framework/util.py index b6aa3568a58..b9a76aef304 100644 --- a/test/functional/test_framework/util.py +++ b/test/functional/test_framework/util.py @@ -251,7 +251,7 @@ class Binaries: def __init__(self, paths, bin_dir, *, use_valgrind=False): self.paths = paths self.bin_dir = bin_dir - suppressions_file = pathlib.Path(__file__).parents[3] / "contrib" / "valgrind.supp" + suppressions_file = pathlib.Path(__file__).resolve().parents[3] / "contrib" / "valgrind.supp" self.valgrind_cmd = [ "valgrind", f"--suppressions={suppressions_file}",