Skip to content

Parallel Electron focus makes duplicate command-palette shortcut assertion flaky #13468

Description

@JordanNoone

Summary

The desktop command-bar setting test also tries to verify Mod+K immediately after closing the palette. Ubuntu CI runs four Electron windows on one shared display, so that duplicate shortcut assertion intermittently sends no key event to this test's renderer and passes only on the isolated retry.

This is a desktop test-harness focus defect, not a command-palette product race.

Reproduction

The affected test in e2e/playwright/command-bar-tests.spec.ts does the following:

  1. Open the command palette by clicking its button.
  2. Close it with Escape.
  3. Reopen it with Mod+K.
  4. Continue through a multi-step debug-panel setting flow.

Across seven sampled hourly Ubuntu desktop runs, step 3 failed on the four-worker first run in all seven and passed on the isolated --last-failed retry.

Representative baseline: https://github.com/KittyCAD/modeling-app/actions/runs/33291559648/job/99204562451

Root-cause evidence

Temporary capture-phase logging recorded the command machine state and the keymap binding selected for Mod+K:

  • Four-worker first run: no Mod+K event reached the keymap listener; after 250 ms the command machine was still Closed.
  • One-worker isolated retry: the event resolved to command-palette.open from state Closed, and the machine became Selecting command.

Diagnostic run: https://github.com/KittyCAD/modeling-app/actions/runs/33320150808/job/99281435652

CI also rejected app-state fixes for stale keymap scope and delayed transition cleanup. An explicit page.bringToFront() passed once but failed again after the branch was rebuilt on main, because foreground ownership is not atomic while other Electron workers share the display.

Bring-to-front counterexample: https://github.com/KittyCAD/modeling-app/actions/runs/33321342642/job/99283913271

Proposed fix

Keep responsibilities separate:

  • The setting-flow test reopens the palette through its stable in-app Commands button.
  • The immediately following dedicated keybinding test remains responsible for real Mod+K coverage. It explicitly focuses the code editor first and already passes in the parallel shard.

Draft fix: #13473.

Plain-English test intent

The complex setting test should verify command selection and argument behavior. The dedicated shortcut test should verify Mod+K. Neither test needs to duplicate the other while depending on shared desktop-window focus.

Classification

Desktop Playwright harness flake caused by parallel Electron window focus and duplicated shortcut coverage.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/command-paletteAnything to do with the command palette (or command bar) systemarea/tests/e2ecodexdesktop-appRelates specifically to the desktop app capabilities.javascriptPull requests that update Javascript code

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions