Only run valgrind on the binary under test
This commit is contained in:
Andrew Noyes 2022-09-26 09:14:15 -07:00 committed by GitHub
parent f95c22c6a2
commit dc828d8407
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -335,7 +335,12 @@ class TestRun:
command: List[str] = [] command: List[str] = []
env: Dict[str, str] = os.environ.copy() env: Dict[str, str] = os.environ.copy()
valgrind_file: Path | None = None valgrind_file: Path | None = None
if self.use_valgrind: if self.use_valgrind and self.binary == config.binary:
# Only run the binary under test under valgrind. There's nothing we
# can do about valgrind errors in old binaries anyway, and it makes
# the test take longer. Also old binaries weren't built with
# USE_VALGRIND=ON, and we have seen false positives with valgrind in
# such binaries.
command.append('valgrind') command.append('valgrind')
valgrind_file = self.temp_path / Path('valgrind-{}.xml'.format(self.random_seed)) valgrind_file = self.temp_path / Path('valgrind-{}.xml'.format(self.random_seed))
dbg_path = os.getenv('FDB_VALGRIND_DBGPATH') dbg_path = os.getenv('FDB_VALGRIND_DBGPATH')