Skip to content

test(desktop): workhub-layout e2e crashes Electron when the native menu auto-dismisses before closePopup #5917

Description

@liugddx

apps/desktop/e2e/workhub-layout.spec.ts › "WorkHub uses its coordination model and shared attachment composer" fails intermittently in the Linux Desktop e2e step. The main process dies mid-test.

Seen on two unrelated PRs:

In both cases a rerun passes.

Mechanism. The spec opens the Workbar's native "Add panel" menu, then closes it in two steps:

  1. It reads the renderer's aria-expanded.
  2. If that is true, it calls workbarMenu.closePopup(window) in a separate mainWindow.evaluate.

The spec's own comment records that Linux auto-dismisses this popup (for example after window resizes), and that closePopup on a dead popup crashes the main process. The two steps are separate round trips, so the popup can auto-dismiss after step 1 and before step 2. The test then crashes Electron itself. Product code never calls closePopup, so this is a test-side race, not a product bug.

Fix: track the popup's lifetime in the main process with its menu-will-close event, and check that flag in the same main-process task that calls closePopup.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions