File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22# /// script
33# requires-python = ">=3.9"
44# dependencies = [
5- # "pytest>=8.0 ",
5+ # "pytest>=8.4.2 ",
66# "pytest-codspeed>=4.2.0",
77# ]
88# ///
1212import shlex
1313import subprocess
1414from pathlib import Path
15+ import time
1516
1617import pytest
1718
@@ -53,7 +54,7 @@ def run_valgrind(self, *args: str) -> None:
5354 Args:
5455 *args: Valgrind arguments
5556 """
56- callgrind_output = self .output_dir / f"callgrind.{ os .getpid ()} "
57+ callgrind_output = self .output_dir / f"callgrind.{ os .getpid ()} . { time . time_ns () } "
5758
5859 cmd = [
5960 self .valgrind_path ,
@@ -63,10 +64,16 @@ def run_valgrind(self, *args: str) -> None:
6364 * shlex .split (self .cmd ),
6465 ]
6566
66- result = subprocess .run (cmd )
67+ # Add timeout and capture output to prevent hanging and buffering issues
68+ result = subprocess .run (
69+ cmd ,
70+ capture_output = True ,
71+ text = True ,
72+ )
6773 if result .returncode != 0 :
6874 raise RuntimeError (
69- f"Valgrind execution failed with code { result .returncode } "
75+ f"Valgrind execution failed with code { result .returncode } \n "
76+ f"stderr: { result .stderr } "
7077 )
7178
7279 # Clean up
You can’t perform that action at this time.
0 commit comments