cypress icon indicating copy to clipboard operation
cypress copied to clipboard

Spurious failed spec error closing Cypress Runner window

Open MikeMcC399 opened this issue 1 year ago • 4 comments

Current behavior

An error message is output when closing the Cypress Runner using the runner menu although there was no test running.

We detected that the electron tab running Cypress tests closed unexpectedly.

We have failed the current spec and aborted the run.

Desired behavior

If the Cypress Runner is closed without aborting any tests, such as by using the runner menu (File > Close Window), then no error message should be output.

Test code to reproduce

Execute

cd $(mktemp -d)
git init
npm init -y
npm install cypress
npx cypress open

(Select Continue, if first time using Cypress) Select E2E Testing Select Continue Select Electron Select "Start E2E Testing in Electron" In Cypress Runner select File > Close Window

image

Note error message:

We detected that the electron tab running Cypress tests closed unexpectedly.

We have failed the current spec and aborted the run.

Cypress Version

First reported for versions: 13.0.0 through 13.7.1 Also reproducible on: 14.1.0

Node version

~~v20.11.1~~ v20.18.0 LTS and v22.14.0 LTS

Operating System

Ubuntu 22.04.4 LTS and Ubuntu 24.04.1 LTS Windows 11

Debug Logs

cypress:server:browsers:electron close fired on the BrowserWindow { browserWindowUrl: 'http://localhost:33217/__/' } +12s
  cypress:server:browsers:electron closed event fired +6ms
  cypress:server:windows error removing all extensions { err: TypeError: Object has been destroyed at Object.j (<embedded>:4291:111741) at BrowserWindow.<anonymous> (<embedded>:4291:125370)     at Object.onceWrapper (node:events:629:26)     at BrowserWindow.emit (node:events:526:35), extensions: undefined } +29s
  cypress:server:browsers browser instance exit event received { code: undefined, signal: undefined } +10s
  cypress:server:browsers:electron closing remote interface client { options: {} } +1ms
  cypress:server:browsers:cri-client closing cri client { closed: false, target: 'BE5D0EC6AE749684900A400BC823B24D' } +12s
  cypress:server:browsers:browser-cri-client Target.targetDestroyed { event: { targetId: 'BE5D0EC6AE749684900A400BC823B24D' }, closing: true, closed: false, resettingBrowserTargets: false } +12s
  cypress:server:browsers:cri-client not closing, cri client is already closed { closed: true, target: 'BE5D0EC6AE749684900A400BC823B24D' } +23ms
  cypress:server:browsers:cri-client closed cri client { closed: true, target: 'BE5D0EC6AE749684900A400BC823B24D' } +4ms
  cypress:server:browsers:cri-client closing cri client { closed: false, target: 'ws://127.0.0.1:44319/devtools/browser/8e4ecb82-0413-4e70-9dbc-85b1f4070961' } +3ms
  cypress:server:browsers:cri-client closed cri client { closed: true, target: 'ws://127.0.0.1:44319/devtools/browser/8e4ecb82-0413-4e70-9dbc-85b1f4070961' } +7ms
  cypress:server:util:socket_allowed allowed socket closed, removing { localPort: 60652 } +5s
  cypress:server:browsers:browser-cri-client browser websocket did not close, page was closed { targetId: 'BE5D0EC6AE749684900A400BC823B24D' } +512ms
We detected that the electron tab running Cypress tests closed unexpectedly.

We have failed the current spec and aborted the run.

Other

  • This issue is related to https://github.com/cypress-io/cypress/issues/29228.
  • It is a regression from Cypress 12.7.4.

Edit: replaced repro screenshot

MikeMcC399 avatar Mar 29 '24 16:03 MikeMcC399

I'll add my two cents and confirm this same behavior with Node 20.12.2, Cypress 13.8.1, and Windows 11.

dbry23 avatar Apr 30 '24 15:04 dbry23

@dbry23

I'll add my two cents and confirm this same behavior with Node 20.12.2, Cypress 13.8.1, and Windows 11.

I've rechecked with Cypress 13.15.0 with Node.js v20.17.0 LTS and Windows 11 and I've added that OS to the original post.

MikeMcC399 avatar Sep 27 '24 10:09 MikeMcC399

Screenshot replaced and re-checked also with Ubuntu 24.04.1 LTS. The issue remains reproducible.

MikeMcC399 avatar Sep 27 '24 10:09 MikeMcC399