Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cypress does not connect to browser and does not even attempt to retry to connect, hangs up forever in CI #27446

Closed
danyg opened this issue Aug 2, 2023 · 7 comments
Labels
pkg/electron This is due to an issue in the packages/electron directory stale no activity on this issue for a long period

Comments

@danyg
Copy link

danyg commented Aug 2, 2023

Current behavior

Sometimes (every time more often) Cypress gets stuck starting in CI
It fails to connect to the browser (Electron v106) and it doesn't even seems to retry
this gets stuck until CI times out after 1hs

image

Desired behavior

Cypress should just run or at lest make an attempt to retry to re-run the browser

Test code to reproduce

When enabling debug this is what I see
DEBUG=cypress:launcher*,cypress:server:browsers* npm run cy:run-ct:ci
Package.json cy:run-ct:ci => cypress run --component --browser=electron

relevant ENV PROPS:

  • NODE_OPTIONS: --max_old_space_size=4096
  • CI= TRUE
  • DEBUG=cypress:launcher*,cypress:server:browsers*
+ cd app
+ npx cypress install
[STARTED] Task without title.
[SUCCESS] Task without title.
[STARTED] Task without title.
[SUCCESS] Task without title.
[STARTED] Task without title.
[SUCCESS] Task without title.
+ echo "🧪 Cypress Components Tests"
🧪 Cypress Components Tests
+ DEBUG=cypress:launcher*,cypress:server:browsers* npm run cy:run-ct:ci

> [email protected] cy:run-ct:ci
> cypress run --component --browser=electron

[STARTED] Task without title.
[SUCCESS] Task without title.
[345:0802/154808.456435:ERROR:node_bindings.cc(279)] Most NODE_OPTIONs are not supported in packaged apps. See documentation for more details.

DevTools listening on ws://127.0.0.1:40997/devtools/browser/d971d9c6-779c-4b9a-8b4c-0de6e450b4ac
[570:0802/154808.932355:ERROR:gpu_memory_buffer_support_x11.cc(44)] dri3 extension not supported.
  cypress:server:browsers:utils getBrowsers +0ms
  cypress:launcher:detect detecting if the following browsers are present [ { name: 'chrome', family: 'chromium', channel: 'stable', displayName: 'Chrome', versionRegex: /Google Chrome (\S+)/m, binary: [ 'google-chrome', 'chrome', 'google-chrome-stable' ], minSupportedVersion: 64 }, { name: 'chromium', family: 'chromium', channel: 'stable', displayName: 'Chromium', versionRegex: /Chromium (\S+)/m, binary: [ 'chromium-browser', 'chromium' ], minSupportedVersion: 64 }, { name: 'chrome', family: 'chromium', channel: 'beta', displayName: 'Chrome Beta', versionRegex: /Google Chrome (\S+) beta/m, binary: 'google-chrome-beta', minSupportedVersion: 64 }, { name: 'chrome', family: 'chromium', channel: 'canary', displayName: 'Canary', versionRegex: /Google Chrome Canary (\S+)/m, binary: 'google-chrome-canary', minSupportedVersion: 64 }, { name: 'firefox', family: 'firefox', channel: 'stable', displayName: 'Firefox', versionRegex: /^Mozilla Firefox ([^\sab]+)$/m, binary: 'firefox', minSupportedVersion: 86, validator: [Function: validator] }, { name: 'firefox', family: 'firefox', channel: 'dev', displayName: 'Firefox Developer Edition', versionRegex: /^Mozilla Firefox (\S+b\S*)$/m, binary: [ 'firefox-developer-edition', 'firefox' ], minSupportedVersion: 86 }, { name: 'firefox', family: 'firefox', channel: 'nightly', displayName: 'Firefox Nightly', versionRegex: /^Mozilla Firefox (\S+a\S*)$/m, binary: [ 'firefox-nightly', 'firefox-trunk' ], minSupportedVersion: 86 }, { name: 'edge', family: 'chromium', channel: 'stable', displayName: 'Edge', versionRegex: /Microsoft Edge (\S+)/im, binary: [ 'edge', 'microsoft-edge' ], minSupportedVersion: 79 }, { name: 'edge', family: 'chromium', channel: 'canary', displayName: 'Edge Canary', versionRegex: /Microsoft Edge.+?(\S*(?= canary)|(?<=canary )\S*)/im, binary: [ 'edge-canary', 'microsoft-edge-canary' ], minSupportedVersion: 79 }, { name: 'edge', family: 'chromium', channel: 'beta', displayName: 'Edge Beta', versionRegex: /Microsoft Edge.+?(\S*(?= beta)|(?<=beta )\S*)/im, binary: [ 'edge-beta', 'microsoft-edge-beta' ], minSupportedVersion: 79 }, { name: 'edge', family: 'chromium', channel: 'dev', displayName: 'Edge Dev', versionRegex: /Microsoft Edge.+?(\S*(?= dev)|(?<=dev )\S*)/im, binary: [ 'edge-dev', 'microsoft-edge-dev' ], minSupportedVersion: 79 } ] +0ms
  cypress:server:browsers:utils WebKit is enabled, but there was an error constructing the WebKit browser: { err: Error: Cannot find module 'playwright-webkit' Require stack: - /root/.cache/Cypress/12.13.0/Cypress/resources/app/packages/server/lib/browsers/utils.ts     at Module._resolveFilename (node:internal/modules/cjs/loader:940:15)     at n._resolveFilename (node:electron/js2c/browser_init:249:1105)     at resolve (node:internal/modules/cjs/helpers:108:19) at Function.resolve (evalmachine.<anonymous>:1:742896) at P (<embedded>:4624:68603) at Object.I [as getBrowsers] (<embedded>:4624:69438) at b.machineBrowsers (<embedded>:4201:438566) at S._setCurrentProject (<embedded>:4394:73914) at new S (<embedded>:4394:66935) at new P (<embedded>:4394:120494) at N (<embedded>:4696:439589) at s.exports (<embedded>:4696:533044) at <embedded>:4703:3280 at tryCatcher (/root/.cache/Cypress/12.13.0/Cypress/resources/app/node_modules/bluebird/js/release/util.js:16:23) at Function.<anonymous> (/root/.cache/Cypress/12.13.0/Cypress/resources/app/node_modules/bluebird/js/release/method.js:39:29) at Object.runElectron (<embedded>:4703:3050) at Object.startInMode (<embedded>:4703:5747) at <embedded>:4703:4835 at tryCatcher (/root/.cache/Cypress/12.13.0/Cypress/resources/app/node_modules/bluebird/js/release/util.js:16:23) at Promise._settlePromiseFromHandler (/root/.cache/Cypress/12.13.0/Cypress/resources/app/node_modules/bluebird/js/release/promise.js:512:31) at Promise._settlePromise (/root/.cache/Cypress/12.13.0/Cypress/resources/app/node_modules/bluebird/js/release/promise.js:569:18) at Promise._settlePromise0 (/root/.cache/Cypress/12.13.0/Cypress/resources/app/node_modules/bluebird/js/release/promise.js:614:10) at Promise._settlePromises (/root/.cache/Cypress/12.13.0/Cypress/resources/app/node_modules/bluebird/js/release/promise.js:694:18) at Promise._fulfill (/root/.cache/Cypress/12.13.0/Cypress/resources/app/node_modules/bluebird/js/release/promise.js:638:18) at PromiseArray._resolve (/root/.cache/Cypress/12.13.0/Cypress/resources/app/node_modules/bluebird/js/release/promise_array.js:126:19) at PromiseArray._promiseFulfilled (/root/.cache/Cypress/12.13.0/Cypress/resources/app/node_modules/bluebird/js/release/promise_array.js:144:14) at Promise._settlePromise (/root/.cache/Cypress/12.13.0/Cypress/resources/app/node_modules/bluebird/js/release/promise.js:574:26) at Promise._settlePromise0 (/root/.cache/Cypress/12.13.0/Cypress/resources/app/node_modules/bluebird/js/release/promise.js:614:10) at Promise._settlePromises (/root/.cache/Cypress/12.13.0/Cypress/resources/app/node_modules/bluebird/js/release/promise.js:694:18) at Promise._fulfill (/root/.cache/Cypress/12.13.0/Cypress/resources/app/node_modules/bluebird/js/release/promise.js:638:18) at Promise._settlePromise (/root/.cache/Cypress/12.13.0/Cypress/resources/app/node_modules/bluebird/js/release/promise.js:582:21) at Promise._settlePromise0 (/root/.cache/Cypress/12.13.0/Cypress/resources/app/node_modules/bluebird/js/release/promise.js:614:10) at Promise._settlePromises (/root/.cache/Cypress/12.13.0/Cypress/resources/app/node_modules/bluebird/js/release/promise.js:694:18) at Promise._fulfill (/root/.cache/Cypress/12.13.0/Cypress/resources/app/node_modules/bluebird/js/release/promise.js:638:18) at Promise._settlePromise (/root/.cache/Cypress/12.13.0/Cypress/resources/app/node_modules/bluebird/js/release/promise.js:582:21) at Promise._settlePromise0 (/root/.cache/Cypress/12.13.0/Cypress/resources/app/node_modules/bluebird/js/release/promise.js:614:10) at Promise._settlePromises (/root/.cache/Cypress/12.13.0/Cypress/resources/app/node_modules/bluebird/js/release/promise.js:694:18) at Promise._fulfill (/root/.cache/Cypress/12.13.0/Cypress/resources/app/node_modules/bluebird/js/release/promise.js:638:18) at PromiseArray._resolve (/root/.cache/Cypress/12.13.0/Cypress/resources/app/node_modules/bluebird/js/release/promise_array.js:126:19) at PromiseArray._promiseFulfilled (/root/.cache/Cypress/12.13.0/Cypress/resources/app/node_modules/bluebird/js/release/promise_array.js:144:14) at Promise._settlePromise (/root/.cache/Cypress/12.13.0/Cypress/resources/app/node_modules/bluebird/js/release/promise.js:574:26) at Promise._settlePromise0 (/root/.cache/Cypress/12.13.0/Cypress/resources/app/node_modules/bluebird/js/release/promise.js:614:10) at Promise._settlePromises (/root/.cache/Cypress/12.13.0/Cypress/resources/app/node_modules/bluebird/js/release/promise.js:694:18) at Promise._fulfill (/root/.cache/Cypress/12.13.0/Cypress/resources/app/node_modules/bluebird/js/release/promise.js:638:18) at /root/.cache/Cypress/12.13.0/Cypress/resources/app/node_modules/bluebird/js/release/nodeback.js:42:21 at <embedded>:1969:89084 { code: 'MODULE_NOT_FOUND', requireStack: [ '/root/.cache/Cypress/12.13.0/Cypress/resources/app/packages/server/lib/browsers/utils.ts' ] } } +6ms
  cypress:server:browsers:utils found browsers { browsers: [ { name: 'chrome', family: 'chromium', channel: 'stable', displayName: 'Chrome', version: '107.0.5304.121', path: 'google-chrome', minSupportedVersion: 64, majorVersion: '107' } ] } +297ms
Browserslist: caniuse-lite is outdated. Please run:
  npx update-browserslist-db@latest
  Why you should do it regularly: https://github.com/browserslist/update-db#readme
  cypress:server:browsers:utils searching for browser { nameOrPath: 'electron', filter: { name: 'electron', channel: 'stable' }, knownBrowsers: [ { name: 'chrome', family: 'chromium', channel: 'stable', displayName: 'Chrome', version: '107.0.5304.121', path: 'google-chrome', minSupportedVersion: 64, majorVersion: '107' }, { name: 'electron', channel: 'stable', family: 'chromium', displayName: 'Electron', version: '106.0.5249.51', path: '', majorVersion: 106 } ] } +4s
  cypress:server:browsers:utils getBrowsers +16ms
  cypress:launcher:detect detecting if the following browsers are present [ { name: 'chrome', family: 'chromium', channel: 'stable', displayName: 'Chrome', versionRegex: /Google Chrome (\S+)/m, binary: [ 'google-chrome', 'chrome', 'google-chrome-stable' ], minSupportedVersion: 64 }, { name: 'chromium', family: 'chromium', channel: 'stable', displayName: 'Chromium', versionRegex: /Chromium (\S+)/m, binary: [ 'chromium-browser', 'chromium' ], minSupportedVersion: 64 }, { name: 'chrome', family: 'chromium', channel: 'beta', displayName: 'Chrome Beta', versionRegex: /Google Chrome (\S+) beta/m, binary: 'google-chrome-beta', minSupportedVersion: 64 }, { name: 'chrome', family: 'chromium', channel: 'canary', displayName: 'Canary', versionRegex: /Google Chrome Canary (\S+)/m, binary: 'google-chrome-canary', minSupportedVersion: 64 }, { name: 'firefox', family: 'firefox', channel: 'stable', displayName: 'Firefox', versionRegex: /^Mozilla Firefox ([^\sab]+)$/m, binary: 'firefox', minSupportedVersion: 86, validator: [Function: validator] }, { name: 'firefox', family: 'firefox', channel: 'dev', displayName: 'Firefox Developer Edition', versionRegex: /^Mozilla Firefox (\S+b\S*)$/m, binary: [ 'firefox-developer-edition', 'firefox' ], minSupportedVersion: 86 }, { name: 'firefox', family: 'firefox', channel: 'nightly', displayName: 'Firefox Nightly', versionRegex: /^Mozilla Firefox (\S+a\S*)$/m, binary: [ 'firefox-nightly', 'firefox-trunk' ], minSupportedVersion: 86 }, { name: 'edge', family: 'chromium', channel: 'stable', displayName: 'Edge', versionRegex: /Microsoft Edge (\S+)/im, binary: [ 'edge', 'microsoft-edge' ], minSupportedVersion: 79 }, { name: 'edge', family: 'chromium', channel: 'canary', displayName: 'Edge Canary', versionRegex: /Microsoft Edge.+?(\S*(?= canary)|(?<=canary )\S*)/im, binary: [ 'edge-canary', 'microsoft-edge-canary' ], minSupportedVersion: 79 }, { name: 'edge', family: 'chromium', channel: 'beta', displayName: 'Edge Beta', versionRegex: /Microsoft Edge.+?(\S*(?= beta)|(?<=beta )\S*)/im, binary: [ 'edge-beta', 'microsoft-edge-beta' ], minSupportedVersion: 79 }, { name: 'edge', family: 'chromium', channel: 'dev', displayName: 'Edge Dev', versionRegex: /Microsoft Edge.+?(\S*(?= dev)|(?<=dev )\S*)/im, binary: [ 'edge-dev', 'microsoft-edge-dev' ], minSupportedVersion: 79 } ] +5s
  cypress:server:browsers:utils WebKit is enabled, but there was an error constructing the WebKit browser: { err: Error: Cannot find module 'playwright-webkit' Require stack: - /root/.cache/Cypress/12.13.0/Cypress/resources/app/packages/server/lib/browsers/utils.ts     at Module._resolveFilename (node:internal/modules/cjs/loader:940:15)     at n._resolveFilename (node:electron/js2c/browser_init:249:1105)     at resolve (node:internal/modules/cjs/helpers:108:19) at Function.resolve (evalmachine.<anonymous>:1:742896) at P (<embedded>:4624:68603) at Object.I [as get] (<embedded>:4624:69438) at H (<embedded>:4696:525899) at Object.W (<embedded>:4696:528367) { code: 'MODULE_NOT_FOUND', requireStack: [ '/root/.cache/Cypress/12.13.0/Cypress/resources/app/packages/server/lib/browsers/utils.ts' ] } } +2ms
  cypress:server:browsers:utils found browsers { browsers: [ { name: 'chrome', family: 'chromium', channel: 'stable', displayName: 'Chrome', version: '107.0.5304.121', path: 'google-chrome', minSupportedVersion: 64, majorVersion: '107' } ] } +341ms
  cypress:server:browsers:utils searching for browser { nameOrPath: 'electron', filter: { name: 'electron', channel: 'stable' }, knownBrowsers: [ { name: 'chrome', family: 'chromium', channel: 'stable', displayName: 'Chrome', version: '107.0.5304.121', path: 'google-chrome', minSupportedVersion: 64, majorVersion: '107' }, { name: 'electron', channel: 'stable', family: 'chromium', displayName: 'Electron', version: '106.0.5249.51', path: '', majorVersion: 106 } ] } +358ms

====================================================================================================

  (Run Starting)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Cypress:        12.13.0                                                                        │
  │ Browser:        Electron 106 (headless)                                                        │
  │ Node Version:   v18.12.0 (/usr/local/bin/node)                                                 │
  │ Specs:          42 found (containers/checkout/CheckoutProduct.test.cy.tsx, containers/checkout │
  │                 /CheckoutTreatment.test.cy.tsx, components/agenda_next/AgendaViewModeSelectMob │
  │                 ile.cy.tsx, components/appointments/AppointmentDeletePanel.cy.tsx, components/ │
  │                 appointments/Appointmen...)                                                    │
  │ Searched:       **/*.cy.{js,jsx,ts,tsx}                                                        │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘

Remove .jsons folder /drone/src/app/cypress/reports/.jsons

────────────────────────────────────────────────────────────────────────────────────────────────────
                                                                                                    
  Running:  containers/checkout/CheckoutProduct.test.cy.tsx                                (1 of 42)
  cypress:server:browsers browsers.kill called with no active instance +0ms
  cypress:server:browsers getBrowserLauncher { browser: { name: 'electron', channel: 'stable', family: 'chromium', displayName: 'Electron', version: '106.0.5249.51', path: '', majorVersion: 106, isHeadless: true, isHeaded: false } } +0ms
  cypress:server:browsers opening browser { name: 'electron', channel: 'stable', family: 'chromium', displayName: 'Electron', version: '106.0.5249.51', path: '', majorVersion: 106, isHeadless: true, isHeaded: false } +1ms
  cypress:server:browsers:electron open { browser: { name: 'electron', channel: 'stable', family: 'chromium', displayName: 'Electron', version: '106.0.5249.51', path: '', majorVersion: 106, isHeadless: true, isHeaded: false }, url: 'http://localhost:8080/__/#/specs/runner?file=src/containers/checkout/CheckoutProduct.test.cy.tsx' } +0ms
  cypress:server:browsers:electron received saved state {} +1ms
  cypress:server:browsers:electron browser window options { browser: { name: 'electron', channel: 'stable', family: 'chromium', displayName: 'Electron', version: '106.0.5249.51', path: '', majorVersion: 106, isHeadless: true, isHeaded: false }, url: 'http://localhost:8080/__/#/specs/runner?file=src/containers/checkout/CheckoutProduct.test.cy.tsx', browsers: [ { name: 'chrome', family: 'chromium', channel: 'stable', displayName: 'Chrome', version: '107.0.5304.121', path: 'google-chrome', minSupportedVersion: 64, majorVersion: '107' }, { name: 'electron', channel: 'stable', family: 'chromium', displayName: 'Electron', version: '106.0.5249.51', path: '', majorVersion: 106 } ], userAgent: null, proxyUrl: 'http://localhost:40319', proxyServer: 'http://localhost:40319', socketIoRoute: '/__socket', chromeWebSecurity: true, isTextTerminal: true, downloadsFolder: '/drone/src/app/cypress/downloads', experimentalModifyObstructiveThirdPartyCode: false, experimentalWebKitSupport: false, projectRoot: '/drone/src/app', shouldLaunchNewTab: false, videoApi: undefined, automationMiddleware: { onBeforeRequest: [Function: onBeforeRequest], onAfterResponse: [Function: onAfterResponse] }, x: null, y: null, width: 1280, height: 720, minWidth: 100, minHeight: 100, devTools: false, contextMenu: true, partition: 'persist:run-345', trackState: { width: 'browserWidth', height: 'browserHeight', x: 'browserX', y: 'browserY', devTools: 'isBrowserDevToolsOpen' }, webPreferences: { sandbox: true, partition: null, webSecurity: true, nodeIntegration: false, backgroundThrottling: false }, show: false, resizable: false, frame: true, recordFrameRate: null } +1ms
  cypress:server:browsers:electron launching browser window to url: http://localhost:8080/__/#/specs/runner?file=src/containers/checkout/CheckoutProduct.test.cy.tsx +1ms
  cypress:server:browsers:cri-client connecting { target: 'ws://127.0.0.1:40997/devtools/browser/d971d9c6-779c-4b9a-8b4c-0de6e450b4ac' } +0ms
  cypress:server:browsers:browser-cri-client Attaching to target url about:blank +0ms
  cypress:server:browsers:cri-client connecting { target: 'F9EE035E656BFA441BFA7A74C823D613' } +27ms
  cypress:server:browsers:cri-client registering CDP on event { eventName: 'Network.requestWillBeSent' } +6ms
  cypress:server:browsers:cri-client registering CDP on event { eventName: 'Network.responseReceived' } +1ms
  cypress:server:browsers:electron clearing cache +144ms
  cypress:server:browsers:electron debugger: enable Console and Network +21ms

  cypress:server:browsers browsers.kill called with no active instance +1m
Timed out waiting for the browser to connect. Retrying...
  cypress:server:browsers browsers.kill called with no active instance +5ms
  cypress:server:browsers getBrowserLauncher { browser: { name: 'electron', channel: 'stable', family: 'chromium', displayName: 'Electron', version: '106.0.5249.51', path: '', majorVersion: 106, isHeadless: true, isHeaded: false } } +1ms
  cypress:server:browsers opening browser { name: 'electron', channel: 'stable', family: 'chromium', displayName: 'Electron', version: '106.0.5249.51', path: '', majorVersion: 106, isHeadless: true, isHeaded: false } +0ms
  cypress:server:browsers:electron open { browser: { name: 'electron', channel: 'stable', family: 'chromium', displayName: 'Electron', version: '106.0.5249.51', path: '', majorVersion: 106, isHeadless: true, isHeaded: false }, url: 'http://localhost:8080/__/#/specs/runner?file=src/containers/checkout/CheckoutProduct.test.cy.tsx' } +60s
  cypress:server:browsers:electron received saved state {} +2ms
  cypress:server:browsers:electron browser window options { browser: { name: 'electron', channel: 'stable', family: 'chromium', displayName: 'Electron', version: '106.0.5249.51', path: '', majorVersion: 106, isHeadless: true, isHeaded: false }, url: 'http://localhost:8080/__/#/specs/runner?file=src/containers/checkout/CheckoutProduct.test.cy.tsx', browsers: [ { name: 'chrome', family: 'chromium', channel: 'stable', displayName: 'Chrome', version: '107.0.5304.121', path: 'google-chrome', minSupportedVersion: 64, majorVersion: '107' }, { name: 'electron', channel: 'stable', family: 'chromium', displayName: 'Electron', version: '106.0.5249.51', path: '', majorVersion: 106 } ], userAgent: null, proxyUrl: 'http://localhost:40319', proxyServer: 'http://localhost:40319', socketIoRoute: '/__socket', chromeWebSecurity: true, isTextTerminal: true, downloadsFolder: '/drone/src/app/cypress/downloads', experimentalModifyObstructiveThirdPartyCode: false, experimentalWebKitSupport: false, projectRoot: '/drone/src/app', shouldLaunchNewTab: false, videoApi: undefined, automationMiddleware: { onBeforeRequest: [Function: onBeforeRequest], onAfterResponse: [Function: onAfterResponse] }, x: null, y: null, width: 1280, height: 720, minWidth: 100, minHeight: 100, devTools: false, contextMenu: true, partition: 'persist:run-345', trackState: { width: 'browserWidth', height: 'browserHeight', x: 'browserX', y: 'browserY', devTools: 'isBrowserDevToolsOpen' }, webPreferences: { sandbox: true, partition: null, webSecurity: true, nodeIntegration: false, backgroundThrottling: false }, show: false, resizable: false, frame: true, recordFrameRate: null } +0ms
  cypress:server:browsers:electron launching browser window to url: http://localhost:8080/__/#/specs/runner?file=src/containers/checkout/CheckoutProduct.test.cy.tsx +1ms
  cypress:server:browsers:browser-cri-client Attaching to target url about:blank +60s
  cypress:server:browsers:cri-client connecting { target: '8801313B9F45B877A238D7E0458FA1EA' } +60s
  cypress:server:browsers:cri-client registering CDP on event { eventName: 'Network.requestWillBeSent' } +6ms
  cypress:server:browsers:cri-client registering CDP on event { eventName: 'Network.responseReceived' } +0ms
  cypress:server:browsers:electron clearing cache +72ms
  cypress:server:browsers:electron debugger: enable Console and Network +4ms
webpack compiled successfully
No issues found.
  cypress:server:browsers browser opened +846ms
  cypress:server:browsers killing browser process +0ms
  cypress:server:browsers:electron closed event fired +768ms
  cypress:server:browsers browser process killed +1ms
  cypress:server:browsers browser opened +1s


  cypress:server:browsers:cri-client encountered closed websocket on send { command: 'Network.getAllCookies', params: undefined, err: Error: WebSocket is not open: readyState 3 (CLOSED) at O (<embedded>:2460:506410) at A.send (<embedded>:2460:501736) at _._enqueueCommand (<embedded>:2460:522212) at <embedded>:2460:519727 at new Promise (<anonymous>) at _.send (<embedded>:2460:519701) at k.send [as sendDebuggerCommandFn] (<embedded>:4624:75173) at k.getAllCookies (<embedded>:4624:45647) at onRequest (<embedded>:4624:46309) at <embedded>:4624:94424 at As (<embedded>:2853:4563) at s (<embedded>:2853:32892) at <embedded>:4624:61584 at f.getCookies (<embedded>:4624:50679) at <embedded>:4624:62260 at tryCatcher (/root/.cache/Cypress/12.13.0/Cypress/resources/app/node_modules/bluebird/js/release/util.js:16:23) at Function.<anonymous> (/root/.cache/Cypress/12.13.0/Cypress/resources/app/node_modules/bluebird/js/release/method.js:39:29) at c.normalize (<embedded>:4624:62147) at <embedded>:4624:63214 at tryCatcher (/root/.cache/Cypress/12.13.0/Cypress/resources/app/node_modules/bluebird/js/release/util.js:16:23) at Promise._settlePromiseFromHandler (/root/.cache/Cypress/12.13.0/Cypress/resources/app/node_modules/bluebird/js/release/promise.js:512:31) at Promise._settlePromise (/root/.cache/Cypress/12.13.0/Cypress/resources/app/node_modules/bluebird/js/release/promise.js:569:18) at Promise._settlePromiseCtx (/root/.cache/Cypress/12.13.0/Cypress/resources/app/node_modules/bluebird/js/release/promise.js:606:10) at _drainQueueStep (/root/.cache/Cypress/12.13.0/Cypress/resources/app/node_modules/bluebird/js/release/async.js:142:12) at _drainQueue (/root/.cache/Cypress/12.13.0/Cypress/resources/app/node_modules/bluebird/js/release/async.js:131:9) at Async._drainQueues (/root/.cache/Cypress/12.13.0/Cypress/resources/app/node_modules/bluebird/js/release/async.js:147:5) at Immediate.<anonymous> (/root/.cache/Cypress/12.13.0/Cypress/resources/app/node_modules/bluebird/js/release/async.js:17:14)     at process.processImmediate (node:internal/timers:466:21) } +4s
  cypress:server:browsers:cri-client disconnected, attempting to reconnect... { closed: true } +0ms

Cypress Version

12.13.0

Node version

18.12.0

Operating System

Linux in Docker using image: cypress/browsers:node18.12.0-chrome107

Debug Logs

Added in step to reproduce

Other

No response

@nagash77
Copy link
Contributor

nagash77 commented Aug 3, 2023

Hi @danyg , I have seen similar behavior before when there are multiple instances of Cypress running at the same time. Can you share the what the command cy:run-ct:ci is and what it is doing? Do you see the same behavior if you enable debug logs and run Cypress without using your custom command?

@nagash77 nagash77 self-assigned this Aug 3, 2023
@danyg
Copy link
Author

danyg commented Aug 7, 2023

@nagash77 as reported in the debug output, Yes, the behaviour can be reproduced when debugging.
also from the logs you can see that cy:run-ct:ci is translated to cypress run --component --browser=electron

> [email protected] cy:run-ct:ci
> cypress run --component --browser=electron

Do you think something will change by running it outside of npm, is not a custom command, is in fact a npm script shouldn't add noise.

The error is erratic only happens sometimes. But lately, a big percentage of our builds are affected by this, and we are forced to manually restart them, which messes up our delivery process.
image
All those reds are due this errors in someway or another... is a lot of false negatives there... is being quite anoying

It cannot be a problem of multiple instances of cypress as this is run inside a docker as part of our CI (Continous Integration, pipelines) and is the only process and task running in the environment (as is inside a docker)

@danyg
Copy link
Author

danyg commented Aug 9, 2023

Just if this helps others or with the investigation, the issue seems to be related with electron.
We have changed the browser to chrome and that fixed it.
Actually, our E2E Suite runs in chrome and it didn't present any issues.

I would argue that Cypress should try to retry or have some sort of watchdog that forces a retry 🤷

@f2404
Copy link

f2404 commented Aug 9, 2023

@danyg Thanks! Switching from electron to chromium seems to have resolved my issue as well.

@nagash77 nagash77 removed their assignment Aug 18, 2023
@jennifer-shehane jennifer-shehane added stage: needs information Not enough info to reproduce the issue pkg/electron This is due to an issue in the packages/electron directory labels Dec 17, 2023
@cypress-app-bot
Copy link
Collaborator

This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided.

@cypress-app-bot cypress-app-bot added the stale no activity on this issue for a long period label Jun 15, 2024
@cypress-app-bot
Copy link
Collaborator

This issue has been closed due to inactivity.

@cypress-app-bot cypress-app-bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 29, 2024
@Jikodis
Copy link

Jikodis commented Oct 10, 2024

I saw this issue in Azure Pipelines as well, and changing the browser it runs in to chrome worked for me as well.

@jennifer-shehane jennifer-shehane removed the stage: needs information Not enough info to reproduce the issue label Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg/electron This is due to an issue in the packages/electron directory stale no activity on this issue for a long period
Projects
None yet
Development

No branches or pull requests

6 participants