(
suite: str,
runner_command: list[str],
log_dir: pathlib.Path,
timeout: int,
)
| 92 | |
| 93 | |
| 94 | def start_suite( |
| 95 | suite: str, |
| 96 | runner_command: list[str], |
| 97 | log_dir: pathlib.Path, |
| 98 | timeout: int, |
| 99 | ) -> ActiveSuite | None: |
| 100 | log_path = log_dir / f"{suite}.log" |
| 101 | log_file = log_path.open("wb") |
| 102 | popen_args: dict[str, object] = { |
| 103 | "stdout": log_file, |
| 104 | "stderr": subprocess.STDOUT, |
| 105 | } |
| 106 | if os.name == "nt": |
| 107 | popen_args["creationflags"] = subprocess.CREATE_NEW_PROCESS_GROUP |
| 108 | else: |
| 109 | popen_args["start_new_session"] = True |
| 110 | try: |
| 111 | process = subprocess.Popen(runner_command + [suite], **popen_args) |
| 112 | except OSError as exc: |
| 113 | log_file.close() |
| 114 | append_log(log_path, f" FAIL: could not start suite {suite!r}: {exc}") |
| 115 | return None |
| 116 | return ActiveSuite( |
| 117 | name=suite, |
| 118 | process=process, |
| 119 | log_path=log_path, |
| 120 | log_file=log_file, |
| 121 | started=time.monotonic(), |
| 122 | timeout=timeout, |
| 123 | ) |
| 124 | |
| 125 | |
| 126 | def windows_descendants(pid: int, timeout: int) -> bool: |
no test coverage detected