Skip to content

test: keep the window server's Space window lists out of unit tests - #640

Merged
acsandmann merged 1 commit into
acsandmann:mainfrom
joonhoekim:pr/test-space-window-lists
Nov 2, 2026
Merged

acsandmann merged 1 commit into
acsandmann:mainfrom
joonhoekim:pr/test-space-window-lists

Conversation

@joonhoekim

Copy link
Copy Markdown
Contributor

Problem

Two reactor tests fail on a Mac that is in use, and pass on CI:

  • named_pin_reload_moves_immediately_without_growing_catalog
  • empty_active_space_membership_during_wake_race_does_not_blank_known_active_windows

With no override set, try_space_window_list_for_connection calls
SLSCopyWindowsWithOptionsAndTags in tests too. The tests use Space ids 1 and
2, and on a desktop Mac Space 1 is the real first desktop, so the query returns
the machine's own windows instead of the test's. The synthetic
windows are missing from that list and are marked hidden. In the named pin
test, the window's first move goes through; the window is then Hidden,
can_place_window refuses the second move, and no pre-layout frame write is
produced.

Reproduce

On a Mac with windows open on its first desktop:

cargo test --lib named_pin_reload_moves_immediately_without_growing_catalog

It fails on main (adca720), which passed CI. Overriding the window list
with an empty one makes it pass.

Fix

In tests, the function returns the override, or an empty list, and never asks
the WindowServer. Tests that need a window list already set one.

Testing

  • cargo test --lib on main: 884 passed, 2 failed (the two above). With
    this commit: 886 passed.
  • cargo +nightly fmt --all --check.

With no override set, try_space_window_list_for_connection asked the real
WindowServer, and the tests' Space ids are real desktops on a Mac in use.
Their windows replaced the test's in the membership, so a test window was
taken as hidden: named_pin_reload_moves_immediately_without_growing_catalog
and empty_active_space_membership_during_wake_race_does_not_blank_known_active_windows
failed on any Mac with windows open on Space 1 and passed only on CI.

In tests the function now returns the override, or an empty list.
@acsandmann
acsandmann merged commit aa295be into acsandmann:main Nov 2, 2026
2 checks passed
@azuwis azuwis mentioned this pull request Nov 3, 2026
5 of 13 tasks
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.

2 participants