| [gw0] darwin -- Python 3.10.11 /Library/Frameworks/Python.framework/Versions/3.10/bin/python3.10
|
|
|
| py = '3.11'
|
|
|
| @allpythons()
|
| def test_pipe_cpu_time(py):
|
| > result = austin("-cPi", "1ms", *python(py), target())
|
|
|
| test/functional/test_pipe.py:65:
|
| _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|
|
|
| self = Variant('austin'), timeout = 60, convert = True, expect_fail = False
|
| args = ('-cPi', '1ms', 'python3.11', '/Users/runner/work/austin/austin/test/targets/target34.py')
|
|
|
| def __call__(
|
| self,
|
| *args: str,
|
| timeout: int = 60,
|
| convert: bool = True,
|
| expect_fail: Union[bool, int] = False,
|
| ) -> CompletedProcess:
|
| if not self.path.is_file():
|
| if "PYTEST_CURRENT_TEST" in os.environ:
|
| pytest.skip(f"{self} not available")
|
| else:
|
| raise FileNotFoundError(f"Binary {self.path} not found for {self}")
|
|
|
| extra_args = ["-b"] if "-b, --binary" in self.help else []
|
|
|
| try:
|
| result = run(
|
| [str(self.path)] + extra_args + list(args),
|
| capture_output=True,
|
| timeout=timeout,
|
| )
|
| except Exception as exc:
|
| if (pid := getattr(exc, "pid", None)) is not None:
|
| print_logs(collect_logs(self.name, pid))
|
| raise
|
|
|
| if result.returncode in (-11, 139): # SIGSEGV
|
| print(bt(self.path, result.pid))
|
|
|
| # If we are writing to stdout, check if we need to convert the stream
|
| if result.stdout.startswith(b"MOJ"):
|
| if convert:
|
| try:
|
| result.stdout = demojo(result.stdout)
|
| except Exception as e:
|
| dump_mojo(result.stdout)
|
| raise e
|
| else:
|
| result.stdout = result.stdout.decode()
|
| result.stderr = result.stderr.decode()
|
|
|
| logs = collect_logs(self.name, result.pid)
|
| result.logs = logs
|
|
|
| if result.returncode != int(expect_fail):
|
| print_logs(logs)
|
| > raise RuntimeError(
|
| f"Command {self.name} returned {result.returncode} "
|
| f"while expecting {expect_fail}. Output:\n{result.stdout}\n"
|
| f"Error:\n{result.stderr}"
|
| )
|
| E RuntimeError: Command austin returned -11 while expecting False. Output:
|
| E
|
| E Error:
|
|
|
| test/utils.py:327: RuntimeError
|