From 44ed65b9239a48a18b77d5ecd70032b2296e875d Mon Sep 17 00:00:00 2001 From: Edgar Arakelyan Date: Tue, 17 Nov 2026 19:17:25 -0800 Subject: [PATCH 1/2] test(computers): the base desktop tests wait for the window manager before checking it supervisord has the desktop RUNNING as its process starts (startsecs=0). That process then waits for X and starts the XFCE session, which starts xfwm4, so the root window's WM check read right after could find none yet: _NET_SUPPORTING_WM_CHECK: not found. It failed main at c9472ae1, which only bumps the version, after the same code passed at ea8e6f1d. Both tests that read it now wait up to 60 s for xfwm4 to set it. Co-Authored-By: Claude Opus 5.5 --- tst/integration/computer/base_computer_test.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/tst/integration/computer/base_computer_test.py b/tst/integration/computer/base_computer_test.py index b1da83e90..43fd53b52 100644 --- a/tst/integration/computer/base_computer_test.py +++ b/tst/integration/computer/base_computer_test.py @@ -53,7 +53,7 @@ def test_the_desktop_runs_as_the_session_user_with_the_settings_a_deploy_passes( zone = _exec(name, "readlink", "/etc/localtime").strip() uid = _exec(name, "id", "-u", "user").strip() screen = _exec(name, "xdpyinfo") - wm = _exec(name, "xprop", "-root", "_NET_SUPPORTING_WM_CHECK") + wm = _window_manager(name) # As the session user, whose process it is: root here lacks the ptrace capability to read another's. environment = _exec_as(name, "user", "sh", "-c", 'tr "\\0" "\\n" < /proc/$(pgrep -o -x xfwm4)/environ') accessibility = _exec(name, "pgrep", "-c", "at-spi2-registr") @@ -86,7 +86,7 @@ def test_the_desktop_comes_back_however_often_x_dies(base): time.sleep(1.2) time.sleep(5) running = _all_running(name) - wm = _exec(name, "xprop", "-root", "_NET_SUPPORTING_WM_CHECK") + wm = _window_manager(name) finally: subprocess.run(["docker", "rm", "-f", name], capture_output=True) assert all(" RUNNING " in line for line in running.splitlines()), running @@ -227,5 +227,17 @@ def _all_running(name: str) -> str: return running +def _window_manager(name: str) -> str: + """The root window's WM check once xfwm4 sets it: supervisord has the desktop RUNNING as its process starts + (startsecs=0), which then waits for X and starts the XFCE session, which starts xfwm4.""" + for _ in range(60): + wm = subprocess.run(["docker", "exec", name, "xprop", "-root", "_NET_SUPPORTING_WM_CHECK"], capture_output=True, + text=True).stdout + if "window id #" in wm: + break + time.sleep(1) + return wm + + def _exec(name: str, *argv: str) -> str: return subprocess.run(["docker", "exec", name, *argv], check=True, capture_output=True, text=True).stdout From 9260f99f7839108e1f2dbc00e43435a1a5c9ea2f Mon Sep 17 00:00:00 2001 From: Edgar Arakelyan Date: Tue, 17 Nov 2026 19:38:29 -0800 Subject: [PATCH 2/2] test(computers): name the window manager wait's deadline and poll interval Co-Authored-By: Claude Opus 5.5 --- tst/integration/computer/base_computer_test.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tst/integration/computer/base_computer_test.py b/tst/integration/computer/base_computer_test.py index 43fd53b52..c24110eec 100644 --- a/tst/integration/computer/base_computer_test.py +++ b/tst/integration/computer/base_computer_test.py @@ -27,6 +27,9 @@ pytestmark = [pytest.mark.integration, pytest.mark.int_test_slow] SUPERVISOR = ["supervisorctl", "-c", "/etc/supervisor/supervisord.conf", "status"] +#: How long the window manager may take to claim the screen once supervisord has the desktop RUNNING, and how often the +#: root window is read meanwhile, in seconds. +WINDOW_MANAGER_S, WINDOW_MANAGER_POLL_S = 60, 0.5 ARCH = {"x86_64": "amd64", "amd64": "amd64", "aarch64": "arm64", "arm64": "arm64"}[platform.machine().lower()] @@ -230,13 +233,13 @@ def _all_running(name: str) -> str: def _window_manager(name: str) -> str: """The root window's WM check once xfwm4 sets it: supervisord has the desktop RUNNING as its process starts (startsecs=0), which then waits for X and starts the XFCE session, which starts xfwm4.""" - for _ in range(60): + deadline = time.monotonic() + WINDOW_MANAGER_S + while True: wm = subprocess.run(["docker", "exec", name, "xprop", "-root", "_NET_SUPPORTING_WM_CHECK"], capture_output=True, text=True).stdout - if "window id #" in wm: - break - time.sleep(1) - return wm + if "window id #" in wm or time.monotonic() > deadline: + return wm + time.sleep(WINDOW_MANAGER_POLL_S) def _exec(name: str, *argv: str) -> str: