cypress-io / cypress

Fast, easy and reliable testing for anything that runs in a browser.
https://cypress.io
MIT License
46.79k stars 3.17k forks source link

13.3.3 - Runtime.addBinding will not run as the target browser or tab CRI connection has crashed on CI #28142

Open nemonemi opened 11 months ago

nemonemi commented 11 months ago

Current behavior

Running:  that-and-that/test.spec.ts                (2 of 42)
Runtime.addBinding will not run as the target browser or tab CRI connection has crashed
Error: Runtime.addBinding will not run as the target browser or tab CRI connection has crashed
    at Object.send (<embedded>:4454:77362)
    at p.init (<embedded>:4479:24685)
    at async c.attachCDPClient (<embedded>:4479:22437)
    at async Object.connectToNewSpec (<embedded>:4460:47715)
    at async Object.connectToNewSpec (<embedded>:4460:26591)
    at async v.relaunchBrowser (<embedded>:4526:36627)
From previous event:
    at c (<embedded>:4526:129552)
    at B (<embedded>:4526:130051)
    at <embedded>:4526:136750
    at async runEachSpec (<embedded>:4526:135866)

Desired behavior

This should not be occurring, and the test should be normally passing on CI, as it does locally.

Test code to reproduce

I have no special test code for this use case.

Cypress Version

13.3.2

Node version

v18.15.0

Operating System

Ubuntu 22.04.3

Debug Logs

What exactly to print out? The debug log is waaaaay too large.

Other

No response

JackHowa commented 10 months ago

yeah this causes --browser chrome flag to break for us. Removing the flag allows users to use cypress locally. this did not break in the cloud interestingly for us

I'd rec that cypress deprecates 13.3.3. could not replicate the bug on 13.3.2.

jennifer-shehane commented 10 months ago

@JackHowa @nemonemi That narrows it down if it's only in 13.3.3. It's strange this isn't happening for more people. Do you have an example of a run we could run to recreate this?

villelahdenvuo commented 8 months ago

Happening to us also with 13.6.2. First there is this disconnect:

WebSocket connection closed
Error: WebSocket connection closed
    at _._handleConnectionClose (<embedded>:2466:579841)
    at A.<anonymous> (<embedded>:2466:577905)
    at Object.onceWrapper (node:events:628:26)
    at A.emit (node:events:513:28)
    at A.emitClose (<embedded>:2466:558129)
    at Socket.W (<embedded>:2466:565440)
    at Socket.emit (node:events:513:28)
    at TCP.<anonymous> (node:net:322:12)

And it tries to run another test suite and crashes:

  Running:  public-storefront/general/fault-page.ts                                       (19 of 30)
Runtime.addBinding will not run as browser CRI connection was reset
Error: Runtime.addBinding will not run as browser CRI connection was reset
    at Object.send (<embedded>:4454:45789)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async p.init (<embedded>:4479:26922)
    at async c.attachCDPClient (<embedded>:4479:24682)
    at async Promise.all (index 0)
    at async c.attachCDPClient (<embedded>:4479:24718)
    at async Object.connectToNewSpec (<embedded>:4460:48402)
    at async Object.connectToNewSpec (<embedded>:4460:27007)
    at async v.relaunchBrowser (<embedded>:4526:36742)
DEBU[2024-01-30T10:11:08Z] A non-zero exit code was returned. This is expected if there are test failures. 
qashre commented 4 months ago

Happened also in 13.7.2 version

it doesnot happen often, we see this error once in a while in pipelines, not sure why it happens though

Runtime.enable will not run as browser CRI connection was reset

Error: Runtime.enable will not run as browser CRI connection was reset
    at Object.send (/root/.cache/Cypress/13.7.2/Cypress/resources/app/packages/server/lib/browsers/cri-client.js:236:47)
    at Function.init (/root/.cache/Cypress/13.7.2/Cypress/resources/app/packages/socket/lib/cdp-socket.js:123:9)
    at CDPSocketServer.attachCDPClient (/root/.cache/Cypress/13.7.2/Cypress/resources/app/packages/socket/lib/cdp-socket.js:26:27)
    at Object.connectToNewSpec (/root/.cache/Cypress/13.7.2/Cypress/resources/app/packages/server/lib/browsers/chrome.js:370:9)
    at Object.connectToNewSpec (/root/.cache/Cypress/13.7.2/Cypress/resources/app/packages/server/lib/browsers/index.js:107:9)
    at OpenProject.relaunchBrowser (/root/.cache/Cypress/13.7.2/Cypress/resources/app/packages/server/lib/open_project.js:152:24)

Desired behavior This should not be occurring, and the test should be normally passing on CI, as it does locally.

Test code to reproduce I have no special test code for this use case.We see that one of the FE cypress jobs suddenly fails due to this error.

Cypress Version and tests run in Chromium browser 13.7.2

Node version v20.9.0

We run Cypress in Docker images.

sam-odetoyinbo commented 3 months ago

I am getting the same issue in Jenkins pipeline

No target with given id found
Error: No target with given id found
    at <embedded>:2466:519827
    at _._handleMessage (<embedded>:2466:521860)
    at A.<anonymous> (<embedded>:2466:521673)
    at A.emit (node:events:513:28)
    at g.U (<embedded>:2466:506953)
    at g.emit (node:events:513:28)
    at g.dataMessage (<embedded>:2466:487328)
    at <embedded>:2466:486860
    at <embedded>:2466:478182
    at <embedded>:2466:479134
    at afterWrite (node:internal/streams/writable:500:5)
    at onwrite (node:internal/streams/writable:480:7)
    at Zlib.<anonymous> (node:internal/streams/transform:190:7)
    at Zlib.processCallback (node:zlib:613:8)
Runtime.addBinding will not run as browser CRI connection was reset
Error: Runtime.addBinding will not run as browser CRI connection was reset
    at Object.send (<embedded>:4454:78001)
    at async p.init (<embedded>:4479:24677)
    at async c.attachCDPClient (<embedded>:4479:22437)
    at async Object.connectToNewSpec (<embedded>:4460:47715)
    at async Object.connectToNewSpec (<embedded>:4460:26591)
    at async v.relaunchBrowser (<embedded>:4526:36627)

Cypress version 13.3.2

Node version v20.14.0