From 6c615cd4a8a991446ca707508cbd2130793972bc Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Wed, 28 Oct 2026 19:33:26 -0700 Subject: [PATCH] fix(e2e): wait for the exit line of a killed daemon before starting another crash() killed the daemon but not the command that launched it, which wrote its exit code into the output file after the next launch had started, so that launch looked as if it had ended and was started again. --- e2e/platforms/qemu_windows/windows_platform.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/e2e/platforms/qemu_windows/windows_platform.py b/e2e/platforms/qemu_windows/windows_platform.py index 31be17d0..75f2a07a 100644 --- a/e2e/platforms/qemu_windows/windows_platform.py +++ b/e2e/platforms/qemu_windows/windows_platform.py @@ -239,6 +239,17 @@ class WindowsPlatform: self._agent.exec("taskkill", "/F", "/IM", "komorebi.exe") if not self.wait_for(self._daemon_gone, timeout=20): raise RuntimeError("komorebi did not go") + # the command that launched it writes its exit code to the output file + # when it ends: wait for that line, or it can land in the file of the + # next launch and look like that one ended + self.wait_for(self._exit_line_written, timeout=10) + + def _exit_line_written(self) -> bool: + try: + text = self._agent.get_file(DAEMON_OUTPUT).decode("utf-8", "replace") + except Exception: + return True + return EXIT_LINE in text def _daemon_gone(self) -> bool: listing = self._agent.exec("tasklist", "/fi", "imagename eq komorebi.exe")