|
10 | 10 |
|
11 | 11 | REPO_ROOT = Path(__file__).resolve().parents[1] |
12 | 12 | DEFAULT_BUNDLE = REPO_ROOT / "build" / "installer-bundle" |
| 13 | +LAUNCHER_SELF_CHECK_TIMEOUT_SECONDS = 30 |
13 | 14 |
|
14 | 15 |
|
15 | 16 | def _is_within(path: Path, root: Path) -> bool: |
@@ -131,19 +132,26 @@ def _validate_launcher_self_check(bundle_dir: Path) -> None: |
131 | 132 | raise SystemExit("Invalid launcher path: expected launch_forge.py inside the bundle directory.") |
132 | 133 |
|
133 | 134 | python_executable = _validated_python_executable() |
134 | | - completed = subprocess.run( |
135 | | - [ |
136 | | - str(python_executable), |
137 | | - str(resolved_launcher_path), |
138 | | - "--self-check", |
139 | | - "--json", |
140 | | - "--assert-ready", |
141 | | - ], |
142 | | - cwd=resolved_bundle_dir, |
143 | | - check=False, |
144 | | - capture_output=True, |
145 | | - text=True, |
146 | | - ) |
| 135 | + try: |
| 136 | + completed = subprocess.run( |
| 137 | + [ |
| 138 | + str(python_executable), |
| 139 | + str(resolved_launcher_path), |
| 140 | + "--self-check", |
| 141 | + "--json", |
| 142 | + "--assert-ready", |
| 143 | + ], |
| 144 | + cwd=resolved_bundle_dir, |
| 145 | + check=False, |
| 146 | + capture_output=True, |
| 147 | + text=True, |
| 148 | + timeout=LAUNCHER_SELF_CHECK_TIMEOUT_SECONDS, |
| 149 | + ) |
| 150 | + except subprocess.TimeoutExpired as exc: |
| 151 | + raise SystemExit( |
| 152 | + "Launcher self-check failed: process timed out after " |
| 153 | + f"{LAUNCHER_SELF_CHECK_TIMEOUT_SECONDS} seconds." |
| 154 | + ) from exc |
147 | 155 | if completed.returncode != 0: |
148 | 156 | stderr_output = completed.stderr.strip() |
149 | 157 | stdout_output = completed.stdout.strip() |
|
0 commit comments