Skip to content

Commit ef91809

Browse files
committed
updated
1 parent 6d5829e commit ef91809

1 file changed

Lines changed: 21 additions & 13 deletions

File tree

scripts/validate_installer_bundle.py

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
REPO_ROOT = Path(__file__).resolve().parents[1]
1212
DEFAULT_BUNDLE = REPO_ROOT / "build" / "installer-bundle"
13+
LAUNCHER_SELF_CHECK_TIMEOUT_SECONDS = 30
1314

1415

1516
def _is_within(path: Path, root: Path) -> bool:
@@ -131,19 +132,26 @@ def _validate_launcher_self_check(bundle_dir: Path) -> None:
131132
raise SystemExit("Invalid launcher path: expected launch_forge.py inside the bundle directory.")
132133

133134
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
147155
if completed.returncode != 0:
148156
stderr_output = completed.stderr.strip()
149157
stdout_output = completed.stdout.strip()

0 commit comments

Comments
 (0)