Skip to content

test(computers): the base desktop tests wait for the window manager before checking it - #760

Merged
earakely-scale merged 2 commits into
mainfrom
edgararakelyan/fix-base-desktop-wm-race
Nov 18, 2026
Merged

earakely-scale merged 2 commits into
mainfrom
edgararakelyan/fix-base-desktop-wm-race

Conversation

@earakely-scale

@earakely-scale earakely-scale commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

What

Two base computer tests now wait for the window manager before checking it:

  • test_the_desktop_runs_as_the_session_user_with_the_settings_a_deploy_passes
  • test_the_desktop_comes_back_however_often_x_dies

Each read the root window's _NET_SUPPORTING_WM_CHECK once supervisord had every program RUNNING. But the base's program:desktop has startsecs=0, so supervisord has it RUNNING as soon as its process starts. That process, start-desktop with-x xfce4-session, then waits up to 10 s for X to answer and starts the XFCE session, which starts xfwm4. Read in between, the check finds no window manager: _NET_SUPPORTING_WM_CHECK: not found. The second test waited a fixed 5 s, which has the same race.

Both now read it through _window_manager, which waits up to 60 s for xfwm4 to set it, as _all_running waits for supervisord. Nothing else changes: the tests assert the same things.

Why

It's a race in the test, and it has turned main red:

Both failures read dimensions: 1600x900 pixels, the right screen, and _NET_SUPPORTING_WM_CHECK: not found.

Proof

On an agent-environments-admin VM (amd64), with the published base this branch's sources name:

  • The race, measured. A probe booted the base 5 times. Each time, it polled supervisord until every program was RUNNING, then polled the root window's WM check:

    Boot All RUNNING WM check set Reads in between with no window manager
    1 (first, cold) 3.42 s 3.70 s 1
    2–5 2.83–2.85 s same read 0

    So the window is real even on an idle machine, and a loaded CI runner widens it.

  • The two tests with this change: 3 of 3 runs passed, 2 passed each time (31–33 s).

  • ruff check tst passes.

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; no blocking issues were found.

Summary

The desktop integration tests wait for the window manager before checking it.

  • The desktop tests wait for the window manager before checking its screen claim.

Reviews (2) · Last reviewed commit: "test(computers): name the window manager..." · Reviewed by Greptile

…efore 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 c9472ae, which only bumps the version, after the same code passed
at ea8e6f1. Both tests that read it now wait up to 60 s for xfwm4 to set it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@earakely-scale
earakely-scale marked this pull request as ready for review November 18, 2026 03:21
@earakely-scale
earakely-scale requested a review from a team as a code owner November 18, 2026 03:21
…erval

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@earakely-scale
earakely-scale merged commit 257a972 into main Nov 18, 2026
35 checks passed
@earakely-scale
earakely-scale deleted the edgararakelyan/fix-base-desktop-wm-race branch November 18, 2026 04:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant