fix(smolmachines): raise SmolvmError instead of die() on wait_exec_ready timeout
test / unit (pull_request) Successful in 39s
test / integration (pull_request) Successful in 58s
test / unit (push) Successful in 38s
test / integration (push) Successful in 55s

die() raises Die(SystemExit), which implies a process exit. A timeout in
wait_exec_ready is a bringup failure — raising SmolvmError lets the caller
decide whether it's fatal, consistent with how machine_start failures propagate.
This commit was merged in pull request #123.
This commit is contained in:
2026-06-02 06:29:05 +00:00
parent c39bbe265b
commit a81f0ffa49
2 changed files with 12 additions and 11 deletions
+7 -4
View File
@@ -32,7 +32,6 @@ from dataclasses import dataclass
from pathlib import Path
from typing import Mapping, Sequence
from ...log import die
_SMOLVM = "smolvm"
@@ -218,9 +217,13 @@ def wait_exec_ready(name: str, *, timeout: float = 5.0) -> None:
break
time.sleep(min(delay, remaining))
delay = min(delay * 2, 0.5)
die(
f"smolvm machine {name!r}: exec channel not ready after "
f"{timeout:.0f}s — VM may have failed to boot."
argv = ["smolvm", "machine", "exec", "--name", name, "--", "true"]
raise SmolvmError(
argv,
subprocess.CompletedProcess(
args=argv, returncode=-1, stdout="",
stderr=f"exec channel not ready after {timeout:.0f}s — VM may have failed to boot.",
),
)