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.
This commit is contained in:
LGUG2Z committed 2026-10-30 18:22:44 -07:00
1 parent 4cef0ce510
commit e440a73666
1 file changed
+10 -1
+10 -1
View File
@@ -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