(
args: argparse.Namespace,
socket_path: Path,
command: str,
argument: str | None = None,
session_id: str | None = None,
timeout: float = 30,
)
| 329 | |
| 330 | |
| 331 | def run_debug_command( |
| 332 | args: argparse.Namespace, |
| 333 | socket_path: Path, |
| 334 | command: str, |
| 335 | argument: str | None = None, |
| 336 | session_id: str | None = None, |
| 337 | timeout: float = 30, |
| 338 | ) -> str: |
| 339 | invocation = [args.jcode, "--socket", str(socket_path), "debug"] |
| 340 | if session_id: |
| 341 | invocation += ["-S", session_id] |
| 342 | invocation.append(command) |
| 343 | if argument is not None: |
| 344 | invocation.append(argument) |
| 345 | result = subprocess.run( |
| 346 | invocation, |
| 347 | capture_output=True, |
| 348 | text=True, |
| 349 | env=benchmark_environment(socket_path), |
| 350 | timeout=timeout, |
| 351 | ) |
| 352 | if result.returncode != 0: |
| 353 | raise BenchmarkError(result.stderr.strip() or result.stdout.strip() or f"debug command failed: {command}") |
| 354 | return result.stdout.strip() |
| 355 | |
| 356 | |
| 357 | def fetch_catalog_via_jcode( |
no test coverage detected