mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-11-19 07:08:48 +01:00
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.
This commit is contained in:
1 parent
fecb9d9173
commit
6c615cd4a8
1 file changed
+11
@@ -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")
|
||||
|
||||
Reference in new issue
Block a user