Skip to content

Commit 023ff19

Browse files
fix(ci): capture binary stderr and detect early exit during window-wait
Pass the launched process into assert_window_rendered so it can detect process death before the timeout fires, and surface stderr in the error message. Also capture stderr=PIPE in _launch_executable. Drops html from the Build excluded-modules list.
1 parent bc8f4ba commit 023ff19

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

.github/workflows/scripts/actions.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -328,9 +328,13 @@ def process_tree_pids(self, process_name: str) -> set[int]:
328328
pids.add(process.info["pid"])
329329
return pids
330330

331-
def assert_window_rendered(self, process_name: str = EXE_NAME, timeout: int = 60) -> None:
331+
def assert_window_rendered(self, process_name: str = EXE_NAME, timeout: int = 60, process: "subprocess.Popen | None" = None) -> None:
332332
log(f"Waiting up to {timeout}s for a visible window owned by {process_name}", level="STEP")
333333
for elapsed in range(timeout):
334+
if process is not None and process.poll() is not None:
335+
stderr_output = process.stderr.read().decode("utf-8", errors="replace") if process.stderr else ""
336+
detail = f"\nstderr:\n{stderr_output}" if stderr_output.strip() else ""
337+
raise RuntimeError(f"{process_name} exited with code {process.returncode} before a window appeared{detail}")
334338
if self.visible_window_owned_by(self.process_tree_pids(process_name)):
335339
log(f"Visible GUI window for '{process_name}' present after {elapsed}s", level="PASS")
336340
return
@@ -370,11 +374,11 @@ def assert_log_is_clean(self) -> None:
370374

371375
def _launch_executable(self) -> "subprocess.Popen":
372376
log(f"{EXE_NAME} has been initiated for testing", level="STEP")
373-
return subprocess.Popen([Paths.installed_executable.as_posix()])
377+
return subprocess.Popen([Paths.installed_executable.as_posix()], stderr=subprocess.PIPE)
374378

375379
def _verify_startup(self, process: "subprocess.Popen", test_length: int) -> int:
376380
self.wait_for_process_start(process, EXE_NAME)
377-
self.assert_window_rendered()
381+
self.assert_window_rendered(process=process)
378382
return self.wait_for_process(process, EXE_NAME, test_length)
379383

380384
def _verify_runtime_artifacts(self, test_length: int) -> None:
@@ -574,7 +578,6 @@ class Build:
574578
"sqlite3",
575579
"curses",
576580
"email",
577-
"html",
578581
]
579582

580583
def _data_table(self) -> dict:

0 commit comments

Comments
 (0)