Skip to content

Commit

Permalink
fix: ensure that fatal protocol errors are only limited to the spec t…
Browse files Browse the repository at this point in the history
…hey occurred on (#27720)
  • Loading branch information
ryanthemanuel authored Aug 31, 2023
1 parent 6081751 commit d8b4821
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 8 deletions.
1 change: 1 addition & 0 deletions cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ _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).
- 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).
- Fixed an issue where the release date on the `v13` landing page was a day behind. Fixed in [#27711](https://github.com/cypress-io/cypress/pull/27711).
- Fixed an issue where fatal protocol errors would leak between specs causing all subsequent specs to fail to upload protocol information. Fixed in [#27720](https://github.com/cypress-io/cypress/pull/27720)

## 13.0.0

Expand Down
14 changes: 7 additions & 7 deletions packages/driver/cypress/e2e/commands/sessions/sessions.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ describe('cy.session', { retries: 0 }, () => {
const clearCurrentSessionData = cy.spy(Cypress.session, 'clearCurrentSessionData')

await Cypress.action('runner:test:before:run:async', {
runnable: 'r1',
id: 'r1',
currentRetry: 0,
}, Cypress.state('runnable'))

Expand All @@ -127,7 +127,7 @@ describe('cy.session', { retries: 0 }, () => {
const backendSpy = cy.spy(Cypress, 'backend').log(false)

await Cypress.action('runner:test:before:run:async', {
runnable: 'r1',
id: 'r1',
currentRetry: 0,
}, Cypress.state('runnable'))

Expand All @@ -144,7 +144,7 @@ describe('cy.session', { retries: 0 }, () => {
cy.spy(Cypress, 'action').log(false)

await Cypress.action('runner:test:before:run:async', {
runnable: 'r1',
id: 'r1',
currentRetry: 0,
}, Cypress.state('runnable'))
})
Expand Down Expand Up @@ -839,7 +839,7 @@ describe('cy.session', { retries: 0 }, () => {
cy.spy(Cypress, 'action').log(false)

await Cypress.action('runner:test:before:run:async', {
runnable: 'r1',
id: 'r1',
currentRetry: 0,
}, Cypress.state('runnable'))

Expand All @@ -853,7 +853,7 @@ describe('cy.session', { retries: 0 }, () => {
const clearCurrentSessionData = cy.spy(Cypress.session, 'clearCurrentSessionData')

await Cypress.action('runner:test:before:run:async', {
runnable: 'r1',
id: 'r1',
currentRetry: 0,
}, Cypress.state('runnable'))

Expand All @@ -864,7 +864,7 @@ describe('cy.session', { retries: 0 }, () => {
const backendSpy = cy.spy(Cypress, 'backend').log(false)

await Cypress.action('runner:test:before:run:async', {
runnable: 'r1',
id: 'r1',
currentRetry: 0,
}, Cypress.state('runnable'))

Expand All @@ -882,7 +882,7 @@ describe('cy.session', { retries: 0 }, () => {
cy.spy(Cypress, 'action').log(false)

await Cypress.action('runner:test:before:run:async', {
runnable: 'r1',
id: 'r1',
currentRetry: 0,
}, Cypress.state('runnable'))

Expand Down
2 changes: 1 addition & 1 deletion packages/driver/cypress/e2e/commands/window.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ describe('src/cy/commands/window', () => {

cy.viewport(500, 400).then(async () => {
await Cypress.action('runner:test:before:run:async', {
runnable: 'r1',
id: 'r1',
currentRetry: 0,
}, Cypress.state('runnable'))
.then(() => {
Expand Down
3 changes: 3 additions & 0 deletions packages/server/lib/cloud/protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ export class ProtocolManager implements ProtocolManagerShape {
return
}

// Reset the errors here so that we are tracking on them per-spec
this._errors = []

try {
this._beforeSpec(spec)
} catch (error) {
Expand Down
8 changes: 8 additions & 0 deletions packages/server/test/unit/cloud/protocol_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,18 @@ describe('lib/cloud/protocol', () => {
it('should be able to initialize a new spec', () => {
sinon.stub(protocol, 'beforeSpec')

;(protocolManager as any)._errors = [
{
captureMethod: 'cdpClient.on',
},
]

protocolManager.beforeSpec({
instanceId: 'instanceId',
})

expect((protocolManager as any)._errors).to.be.empty

expect(protocol.beforeSpec).to.be.calledWith({
workingDirectory: path.join(os.tmpdir(), 'cypress', 'protocol'),
archivePath: path.join(os.tmpdir(), 'cypress', 'protocol', 'instanceId.tar'),
Expand Down

3 comments on commit d8b4821

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on d8b4821 Aug 31, 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-d8b48211c0fbd2edcd930ddc180aeb8018ee1af4/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on d8b4821 Aug 31, 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-d8b48211c0fbd2edcd930ddc180aeb8018ee1af4/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on d8b4821 Aug 31, 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-d8b48211c0fbd2edcd930ddc180aeb8018ee1af4/cypress.tgz

Please sign in to comment.