Skip to content

test: wait for focus to settle in carousel tests#637

Merged
JimmyCozza merged 1 commit into
mainfrom
test/spawn-race-hardening
Jul 9, 2026
Merged

test: wait for focus to settle in carousel tests#637
JimmyCozza merged 1 commit into
mainfrom
test/spawn-race-hardening

Conversation

@JimmyCozza

Copy link
Copy Markdown
Contributor

Description

Two carousel integration tests acted on client.focus before it had settled. A client still finishing its map could grab focus via focus-on-manage right after the test set client.focus = c1, leaving the carousel centered on the wrong client. test-carousel-vertical-animation then hard-asserted geometry on a fixed poll (c1 landed a full screen above the workarea), and test-carousel-stacking ran its consume against the wrong column. Both flaked in roughly 20% of headless runs.

Both steps now poll until client.focus actually lands on the target client before asserting, so a late focus-on-manage can no longer decide the outcome. Test-only change; no compositor or library code touched.

Test Plan

  • Each test run 20x headless: 20/20 pass (was ~16/20 before).
  • Failure was load-dependent; reproduced deterministically on a quiet system before the fix.

Checklist

  • Lua libraries (lua/awful/, lua/gears/, lua/wibox/, lua/naughty/) are not modified — if a bug surfaces in Lua, the fix belongs in C
  • Tests pass (make test-unit && make test-integration)

The instant-snap and stacking steps acted on client.focus before it
settled, so a late focus-on-manage could leave the carousel centered on
the wrong client (flaky headless, ~20% of runs). Poll until focus lands
on the target client before asserting geometry.
@JimmyCozza JimmyCozza merged commit 9d63ca0 into main Jul 9, 2026
3 checks passed
@JimmyCozza JimmyCozza deleted the test/spawn-race-hardening branch July 9, 2026 17:32
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