(
suite: str,
runner_command: list[str],
log_dir: pathlib.Path,
timeout: int,
)
| 176 | |
| 177 | |
| 178 | def start_suite( |
| 179 | suite: str, |
| 180 | runner_command: list[str], |
| 181 | log_dir: pathlib.Path, |
| 182 | timeout: int, |
| 183 | ) -> ActiveSuite | None: |
| 184 | log_path = log_dir / f"{suite}.log" |
| 185 | log_file = log_path.open("wb") |
| 186 | popen_args: dict[str, object] = { |
| 187 | "stdout": log_file, |
| 188 | "stderr": subprocess.STDOUT, |
| 189 | } |
| 190 | if os.name == "nt": |
| 191 | popen_args["creationflags"] = subprocess.CREATE_NEW_PROCESS_GROUP |
| 192 | else: |
| 193 | popen_args["start_new_session"] = True |
| 194 | try: |
| 195 | process = subprocess.Popen(runner_command + [suite], **popen_args) |
| 196 | except OSError as exc: |
| 197 | log_file.close() |
| 198 | append_log(log_path, f" FAIL: could not start suite {suite!r}: {exc}") |
| 199 | return None |
| 200 | return ActiveSuite( |
| 201 | name=suite, |
| 202 | process=process, |
| 203 | log_path=log_path, |
| 204 | log_file=log_file, |
| 205 | started=time.monotonic(), |
| 206 | timeout=timeout, |
| 207 | ) |
| 208 | |
| 209 | |
| 210 | def windows_tree_cleanup_blocker(pid: int) -> str | None: |
no test coverage detected