From e440a73666f2953b4fcfd0699f40837578607642 Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Wed, 28 Oct 2026 19:33:26 -0700 Subject: [PATCH] fix(e2e): a state that is not JSON is an error a wait goes past komorebic state can print something else while the daemon is busy or in the middle of a monitor change. The runner crashed on it (a hotplug run did); now it is a RuntimeError with what was printed, which waits retry. --- e2e/platforms/qemu_windows/windows_platform.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/e2e/platforms/qemu_windows/windows_platform.py b/e2e/platforms/qemu_windows/windows_platform.py index 5fce440a..15c23f64 100644 --- a/e2e/platforms/qemu_windows/windows_platform.py +++ b/e2e/platforms/qemu_windows/windows_platform.py @@ -330,7 +330,16 @@ class WindowsPlatform: return result["stdout"] def state(self) -> Snapshot: - return parse(json.loads(self.komorebic("state"))) + printed = self.komorebic("state") + try: + return parse(json.loads(printed)) + except ValueError as e: + # a daemon that is busy, or in the middle of a monitor change, can + # print something else: a wait retries, and a check that keeps + # failing shows what it was + raise RuntimeError( + f"komorebic state did not print JSON ({e}): {printed[:300]!r}" + ) from e def spawn( self, title: str, app_id: str | None = None, exe: str | None = None