Skip to content

test(e2e): re-press ⌘K until the palette answers - #1282

Merged
cravenceiling merged 1 commit into
mainfrom
hou-e2e-palette-press-race
Aug 10, 2026
Merged

test(e2e): re-press ⌘K until the palette answers#1282
cravenceiling merged 1 commit into
mainfrom
hou-e2e-palette-press-race

Conversation

@cravenceiling

Copy link
Copy Markdown
Collaborator

What

Fixes the main CI failure in run 31329194483: teams-nav.spec.tsthe palette's recent missions open the mission's chat on that team board timed out 30s waiting for the palette's search input, on both attempts.

Why it failed

The ⌘K shortcut is a window keydown listener the shell attaches in an effect (useKeyboardShortcuts() in workspace-shell.tsx), and effects run after the paint that puts the spec's ready-marker ("Your teams") on screen. The spec pressed ⌘K the instant that marker showed, so on a slow CI runner the single keystroke landed before the listener existed. A keypress, unlike a locator action, has no auto-retry — the press was dropped, the palette never opened, and the spec hung to its timeout.

The failure snapshot proves it: only CommandDialog's always-mounted sr-only header ("Command palette" / "Jump anywhere in Houston" — rendered outside DialogContent, so present even when closed) is in the tree. The dialog itself never opened.

Fix

New e2e/support/palette.tsopenPalette(page): presses ⌘K inside an expect(...).toPass() loop, re-pressing only while the input stays hidden so the shortcut's toggle can't close a palette that did open, and returns the search input. All three palette-open sites in teams-nav.spec.ts now go through it (the other two had the same latent race).

App behavior is untouched — for a human the listener is attached long before any keypress; this is purely a test-timing hardening, same family as c89321b.

Verification

  • pnpm test:e2e e2e/teams-nav.spec.ts — 4/4 pass locally
  • pnpm --filter houston-web typecheck:e2e clean, Biome clean

The palette shortcut is a window keydown listener the shell attaches in an
effect, and effects run after the paint that puts 'Your teams' on screen.
A spec that presses the instant that marker shows can land its single
keystroke before the listener exists — a keypress has no auto-retry, so the
palette never opens and the spec hangs to its 30s timeout. That's exactly
how teams-nav 'recent missions' died twice in a row on main
(run 31329194483): the failure snapshot shows only CommandDialog's
always-mounted sr-only header, no dialog.

openPalette() presses inside an expect.toPass loop, re-pressing only while
the input stays hidden so the shortcut's toggle can't close a palette that
did open. All three palette-open sites in teams-nav.spec.ts now go through
it.
@cravenceiling
cravenceiling merged commit 6c2295b into main Aug 10, 2026
12 checks passed
@cravenceiling
cravenceiling deleted the hou-e2e-palette-press-race branch August 10, 2026 12:12
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