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

Close extra target cause Target.targetDestroyed, and then case failed #28916

Closed
7999 opened this issue Feb 11, 2024 · 15 comments
Closed

Close extra target cause Target.targetDestroyed, and then case failed #28916

7999 opened this issue Feb 11, 2024 · 15 comments
Labels
stage: awaiting response Potential fix was proposed; awaiting response stale no activity on this issue for a long period

Comments

@7999
Copy link

7999 commented Feb 11, 2024

Current behavior

case failed due to:

cypress:server:cypress exiting with err Error: We detected that the Custom Chrome tab running Cypress tests closed unexpectedly

Desired behavior

No response

Test code to reproduce

it's sporadic

Cypress Version

13.6.0

Node version

18.17.1

Operating System

windows10 19045.3930

Debug Logs

2024-02-06T21:18:39.150Z cypress:server:browsers:cri-client registering CDP on event { eventName: 'Inspector.targetReloadedAfterCrash' }
2024-02-06T21:18:39.152Z cypress:server:browsers:browser-cri-client Attaching to target url about:blank
2024-02-06T21:18:39.153Z cypress:server:browsers:browser-cri-client error finding browser target, maybe retrying { delay: 100, err: Error: Could not find url target in browser about:blank. Targets were [] at <embedded>:4454:82918 at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async n (<embedded>:4454:81949) at async Object.open (<embedded>:4460:51628) at async Object.open (<embedded>:4460:27335) at async v.relaunchBrowser (<embedded>:4526:36933) }
2024-02-06T21:18:39.169Z cypress:server:browsers:browser-cri-client Target.attachedToTarget { targetId: 'FA6AEABA17BE62427529A1875D42765F', type: 'page', title: '', url: '', attached: true, canAccessOpener: false, browserContextId: '8B716CFACD9C62A2976C0B7338D69EE5' }
2024-02-06T21:18:39.252Z cypress:server:browsers:browser-cri-client Connect as extra target (id: FA6AEABA17BE62427529A1875D42765F)
2024-02-06T21:18:39.258Z cypress:server:browsers:browser-cri-client Attaching to target url about:blank
2024-02-06T21:18:39.258Z cypress:server:browsers:cri-client connecting { connected: false, target: 'FA6AEABA17BE62427529A1875D42765F' }
2024-02-06T21:18:39.280Z cypress:server:browsers:cri-client connected { connected: true, target: 'FA6AEABA17BE62427529A1875D42765F' }
2024-02-06T21:18:39.345Z cypress:server:browsers:cri-client registering CDP on event { eventName: 'Runtime.bindingCalled' }
2024-02-06T21:18:39.347Z cypress:server:browsers:cri-client registering CDP on event { eventName: 'Runtime.bindingCalled' }
2024-02-06T21:18:39.347Z cypress:server:socket-base socket connected

......

2024-02-06T21:18:45.580Z cypress:server:socket-base backend:request { eventName: 'close:extra:targets', args: [] }
2024-02-06T21:18:45.581Z cypress:server:browsers getBrowserLauncher { browser: { name: 'chrome', family: 'chromium', channel: 'stable', displayName: 'Custom Chrome', versionRegex: /Google Chrome (\S+)/m, binary: [ 'google-chrome', 'chrome', 'google-chrome-stable' ], minSupportedVersion: 64, info: 'Loaded from D:chrome-win\\\\chrome.exe', custom: true, path: 'D:\\\\chrome-win\\\\chrome.exe', version: '109.0.5412.0', majorVersion: '109', isHeadless: true, isHeaded: false } }
2024-02-06T21:18:45.581Z cypress:server:socket-base backend:request { eventName: 'reset:server:state', args: [] }
2024-02-06T21:18:45.581Z cypress:server:remote-states resetting remote state
2024-02-06T21:18:45.581Z cypress:server:browsers:browser-cri-client Close extra target (id: FA6AEABA17BE62427529A1875D42765F)
2024-02-06T21:18:45.584Z cypress:server:browsers:browser-cri-client Target.targetDestroyed { event: { targetId: 'FA6AEABA17BE62427529A1875D42765F' }, closing: false, closed: false, resettingBrowserTargets: false }
2024-02-06T21:18:45.584Z cypress:server:browsers:cri-client closing cri client { closed: false, target: 'FA6AEABA17BE62427529A1875D42765F' }
2024-02-06T21:18:45.586Z cypress:server:browsers:cri-client encountered closed websocket on send { command: 'Runtime.evaluate', params: { expression: '\n' + "        if (window['cypressSocket-/__socket/default'] && window['cypressSocket-/__socket/default'].send) {\n" + `          window['cypressSocket-/__socket/default'].send('"42/__socket/default,[\\\\"c54721e9-1300-44c8-9030-9e38b5e0fad1\\\\",\\\\"833f9cce-51da-403d-9779-5d78bd3d0be8\\\\",[{}]]"')\n` + '        }\n' + '      ', contextId: 2 }, sessionId: undefined, err: Error: WebSocket is not open: readyState 2 (CLOSING) at O (<embedded>:2466:564310) at A.send (<embedded>:2466:559636) at _._enqueueCommand (<embedded>:2466:580382) at <embedded>:2466:577627 at new Promise (<anonymous>) at _.send (<embedded>:2466:577601) at Object.send (<embedded>:4454:45479) at <embedded>:4479:25889 }
2024-02-06T21:18:45.586Z cypress:server:browsers:cri-client enqueueing command {
  command: 'Runtime.evaluate',
  params: {
    expression: '\n' +
      "        if (window['cypressSocket-/__socket/default'] && window['cypressSocket-/__socket/default'].send) {\n" +
      `          window['cypressSocket-/__socket/default'].send('"42/__socket/default,[\\\\"c54721e9-1300-44c8-9030-9e38b5e0fad1\\\\",\\\\"833f9cce-51da-403d-9779-5d78bd3d0be8\\\\",[{}]]"')\n` +
      '        }\n' +
      '      ',
    contextId: 2
  }
}
2024-02-06T21:18:45.586Z cypress:server:browsers:cri-client disconnected, starting retries to reconnect... { closed: true, target: 'FA6AEABA17BE62427529A1875D42765F' }
2024-02-06T21:18:45.586Z cypress:server:browsers:cri-client disconnected, not reconnecting because client is closed { closed: true, target: 'FA6AEABA17BE62427529A1875D42765F' }
2024-02-06T21:18:45.586Z cypress:server:browsers:cri-client connection was closed was trying to reconnect
2024-02-06T21:18:45.587Z cypress:server:browsers:cri-client closed cri client { closed: true, target: 'FA6AEABA17BE62427529A1875D42765F' }
2024-02-06T21:18:45.593Z cypress:server:util:socket_allowed allowed socket closed, removing { localPort: 60998 }
2024-02-06T21:18:46.090Z cypress:server:browsers:browser-cri-client browser websocket did not close, page was closed { targetId: 'FA6AEABA17BE62427529A1875D42765F' }
2024-02-06T21:18:46.093Z cypress:server:run onError
2024-02-06T21:18:46.094Z cypress:server:cypress exiting with err Error: We detected that the Custom Chrome tab running Cypress tests closed unexpectedly.

We have failed the current spec and aborted the run.

Other

No response

@jennifer-shehane
Copy link
Member

@7999 Could you provide a reproducible example?

Does this error happen on Cypress version prior to 13.6.0?

@jennifer-shehane jennifer-shehane added the stage: needs information Not enough info to reproduce the issue label Feb 12, 2024
@7999
Copy link
Author

7999 commented Feb 13, 2024

@jennifer-shehane

  1. sorry, I can't provide an example, because it only happened on our pipeline agent and very sporadic, can't reproduce on local machine. from the log, it can be found that the issue occurred on the step of beforeEach.

2 this issue only happened after we update the version to 13.6.0. BTW, we update the version from 9.3.1 to 13.6.0

@jennifer-shehane
Copy link
Member

@7999 Could you try Cypress 13.5.1 to see if the issue is resolved in that version?

@7999
Copy link
Author

7999 commented Feb 15, 2024

@jennifer-shehane
fine, but it will take some time.

@7999
Copy link
Author

7999 commented Mar 12, 2024

try version 13.5.1 and monitoring.

@jennifer-shehane
Copy link
Member

@7999 Any updates?

@7999
Copy link
Author

7999 commented Mar 15, 2024

@jennifer-shehane
still monitoring with version 13.5.1, night build pipeline run succussed one week, need more data to prove

@7999
Copy link
Author

7999 commented Mar 26, 2024

@jennifer-shehane
the version 13.5.1 works well more than two weeks now

@jennifer-shehane jennifer-shehane removed the stage: needs information Not enough info to reproduce the issue label Mar 29, 2024
@7999
Copy link
Author

7999 commented Mar 31, 2024

@jennifer-shehane
is there any plan to fix this issue in new version?

@jennifer-shehane
Copy link
Member

jennifer-shehane commented Apr 1, 2024

@7999 Is this happening in newer versions? My assumption was that this was resolved.

@7999
Copy link
Author

7999 commented Apr 1, 2024

@jennifer-shehane
the newer version you mean greater than version 13.6.0? this issue happened on version13.6.0, we try the version 13.5.1 work well

@jennifer-shehane
Copy link
Member

Sorry, I got very confused in this thread. @7999 Have you tried any of our newer versions to see if this Target.targetDestroyed error disappears? We made a change in 13.6.5 that I thought might fix this error in some cases. If not, we'll leave this open.

@jennifer-shehane jennifer-shehane added the stage: awaiting response Potential fix was proposed; awaiting response label Apr 2, 2024
@7999
Copy link
Author

7999 commented Apr 3, 2024

@jennifer-shehane
we found this Target.targetDestroyed issue on version 13.6.0, and you let me try the version 13.5.1,
image
so only i can said is that the version 13.5.1 work well now, i don't know any newer version, because we can't switch the new version in our project casually.

@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 Dec 8, 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 Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stage: awaiting response Potential fix was proposed; awaiting response stale no activity on this issue for a long period
Projects
None yet
Development

No branches or pull requests

3 participants