Skip to content

Commit

Permalink
fix: make CDP errors non fatal (#27709)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanthemanuel committed Aug 30, 2023
1 parent cbf266c commit 7072f3c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 4 additions & 0 deletions cli/CHANGELOG.md
Expand Up @@ -11,6 +11,10 @@ _Released 09/12/2023 (PENDING)_

- Fixed a regression introduced in Cypress [13.0.0](#13-0-0) where the [Module API](https://docs.cypress.io/guides/guides/module-api), [`after:run`](https://docs.cypress.io/api/plugins/after-run-api), and [`after:spec`](https://docs.cypress.io/api/plugins/after-spec-api) results did not include the `stats.skipped` field for each run result. Fixes [#27694](https://github.com/cypress-io/cypress/issues/27694). Addressed in [#27695](https://github.com/cypress-io/cypress/pull/27695).

**Bugfixes:**

- Individual CDP errors that occur while capturing data for test replay will no longer prevent the entire run from being available. Addressed in [#27709](https://github.com/cypress-io/cypress/pull/27709).

## 13.0.0

_Released 08/29/2023_
Expand Down
7 changes: 5 additions & 2 deletions packages/server/lib/cloud/protocol.ts
Expand Up @@ -112,7 +112,7 @@ export class ProtocolManager implements ProtocolManagerShape {
await listener(message)
} catch (error) {
if (CAPTURE_ERRORS) {
this._errors.push({ captureMethod: 'cdpClient.on', fatal: true, error, args: [event, message] })
this._errors.push({ captureMethod: 'cdpClient.on', fatal: false, error, args: [event, message] })
} else {
debug('error in cdpClient.on %O', { error, event, message })
throw error
Expand All @@ -137,8 +137,11 @@ export class ProtocolManager implements ProtocolManagerShape {
try {
this._beforeSpec(spec)
} catch (error) {
// Clear out protocol since we will not have a valid state when spec has failed
this._protocol = undefined

if (CAPTURE_ERRORS) {
this._errors.push({ captureMethod: 'beforeSpec', error, args: [spec], runnableId: this._runnableId })
this._errors.push({ captureMethod: 'beforeSpec', fatal: true, error, args: [spec], runnableId: this._runnableId })
} else {
throw error
}
Expand Down

5 comments on commit 7072f3c

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 7072f3c Aug 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the linux x64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/13.1.0/linux-x64/develop-7072f3c16844716be3d0c0129d1314e548e76cf5/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 7072f3c Aug 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the linux arm64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/13.1.0/linux-arm64/develop-7072f3c16844716be3d0c0129d1314e548e76cf5/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 7072f3c Aug 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the darwin x64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/13.1.0/darwin-x64/develop-7072f3c16844716be3d0c0129d1314e548e76cf5/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 7072f3c Aug 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the win32 x64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/13.1.0/win32-x64/develop-7072f3c16844716be3d0c0129d1314e548e76cf5/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 7072f3c Aug 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the darwin arm64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/13.1.0/darwin-arm64/develop-7072f3c16844716be3d0c0129d1314e548e76cf5/cypress.tgz

Please sign in to comment.