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:
- It reads the renderer's
aria-expanded.
- 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.
apps/desktop/e2e/workhub-layout.spec.ts› "WorkHub uses its coordination model and shared attachment composer" fails intermittently in the LinuxDesktop e2estep. The main process dies mid-test.Seen on two unrelated PRs:
jsHandle.evaluate: Target page, context or browser has been closed, atworkhub-layout.spec.ts:137.expect(locator).not.toHaveAttribute ... Protocol error (Runtime.callFunctionOn): ... session closed, at:140.In both cases a rerun passes.
Mechanism. The spec opens the Workbar's native "Add panel" menu, then closes it in two steps:
aria-expanded.true, it callsworkbarMenu.closePopup(window)in a separatemainWindow.evaluate.The spec's own comment records that Linux auto-dismisses this popup (for example after window resizes), and that
closePopupon 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 callsclosePopup, 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-closeevent, and check that flag in the same main-process task that callsclosePopup.