Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
<!-- See the ../guides/writing-the-cypress-changelog.md for details on writing the changelog. -->
## 15.4.1
## 15.5.0

_Released 10/21/2025 (PENDING)_

**Features:**

- When `cypress run` is used with both `--record` and `--posix-exit-codes` enabled, Cypress will now exit with code `112` when it cannot determine which spec to run next due to network conditions. Addresses [#32485](https://github.com/cypress-io/cypress/issues/32485). Addressed in [#32635](https://github.com/cypress-io/cypress/pull/32635).

**Bugfixes:**

- An error is no longer thrown during command execution when the application under test overwrites the `window.$` property with a non-function. Fixes [#1502](https://github.com/cypress-io/cypress/issues/1502). Fixed in [#32682](https://github.com/cypress-io/cypress/pull/32682).
Expand Down
2 changes: 2 additions & 0 deletions packages/data-context/schemas/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -1134,7 +1134,9 @@ enum ErrorTypeEnum {
CLOUD_CANNOT_CONFIRM_ARTIFACTS
CLOUD_CANNOT_CREATE_RUN_OR_INSTANCE
CLOUD_CANNOT_PROCEED_IN_PARALLEL
CLOUD_CANNOT_PROCEED_IN_PARALLEL_NETWORK
CLOUD_CANNOT_PROCEED_IN_SERIAL
CLOUD_CANNOT_PROCEED_IN_SERIAL_NETWORK
CLOUD_CANNOT_UPLOAD_ARTIFACTS
CLOUD_GRAPHQL_ERROR
CLOUD_INVALID_RUN_REQUEST
Expand Down
30 changes: 30 additions & 0 deletions packages/errors/src/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,21 @@ export const AllCypressErrors = {
ciBuildId: '--ciBuildId',
})}`
},
CLOUD_CANNOT_PROCEED_IN_PARALLEL_NETWORK: (arg1: { flags: any, response: Error }) => {
const message = normalizeNetworkErrorMessage(arg1.response)

return errTemplate`\
We encountered an unexpected error communicating with our servers.

${fmt.highlightSecondary(message)}

Because you passed the ${fmt.flag(`--parallel`)} flag, this run cannot proceed since it requires a valid response from our servers.

${fmt.listFlags(arg1.flags, {
group: '--group',
ciBuildId: '--ciBuildId',
})}`
},
CLOUD_CANNOT_PROCEED_IN_SERIAL: (arg1: { flags: any, response: Error }) => {
const message = normalizeNetworkErrorMessage(arg1.response)

Expand All @@ -188,6 +203,21 @@ export const AllCypressErrors = {
ciBuildId: '--ciBuildId',
})}`
},
CLOUD_CANNOT_PROCEED_IN_SERIAL_NETWORK: (arg1: { flags: any, response: Error }) => {
const message = normalizeNetworkErrorMessage(arg1.response)

return errTemplate`\
We encountered an unexpected error communicating with our servers.

${fmt.highlightSecondary(message)}

Because you passed the ${fmt.flag(`--record`)} flag, this run cannot proceed since it requires a valid response from our servers.

${fmt.listFlags(arg1.flags, {
group: '--group',
ciBuildId: '--ciBuildId',
})}`
},
CLOUD_UNKNOWN_INVALID_REQUEST: (arg1: { flags: any, response: Error }) => {
const message = normalizeNetworkErrorMessage(arg1.response)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
We encountered an unexpected error communicating with our servers.
Copy link
Contributor

Choose a reason for hiding this comment

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

this is so much easier to diff now

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It really really is!


Error: fail whale

Because you passed the --parallel flag, this run cannot proceed since it requires a valid response from our servers.

The --group flag you passed was: foo
The --ciBuildId flag you passed was: invalid
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
We encountered an unexpected error communicating with our servers.

Error: fail whale

Because you passed the --record flag, this run cannot proceed since it requires a valid response from our servers.

The --group flag you passed was: foo
The --ciBuildId flag you passed was: invalid
22 changes: 22 additions & 0 deletions packages/errors/test/visualSnapshotErrors.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,17 @@ describe('visual error templates', () => {
}],
}
},
CLOUD_CANNOT_PROCEED_IN_PARALLEL_NETWORK: () => {
return {
default: [{
flags: {
ciBuildId: 'invalid',
group: 'foo',
},
response: makeErr(),
}],
}
},
CLOUD_CANNOT_PROCEED_IN_SERIAL: () => {
return {
default: [{
Expand All @@ -247,6 +258,17 @@ describe('visual error templates', () => {
}],
}
},
CLOUD_CANNOT_PROCEED_IN_SERIAL_NETWORK: () => {
return {
default: [{
flags: {
ciBuildId: 'invalid',
group: 'foo',
},
response: makeErr(),
}],
}
},
CLOUD_UNKNOWN_INVALID_REQUEST: () => {
return {
default: [{
Expand Down
8 changes: 0 additions & 8 deletions packages/server/__snapshots__/cypress_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -422,14 +422,6 @@ exports['CLOUD_RECOMMENDATION_MESSAGE'] = `
----------------------------------------------------------------------------------------------------
`

exports['RECORD_PARAMS_WITHOUT_RECORDING-no-auto-cancel-after-failures 1'] = `
You passed the --ci-build-id, --group, --tag, --parallel, or --auto-cancel-after-failures flag without also passing the --record flag.

These flags can only be used when recording to Cypress Cloud.

https://on.cypress.io/record-params-without-recording
`

exports['RECORD_PARAMS_WITHOUT_RECORDING-auto-cancel-after-failures 1'] = `
You passed the --ci-build-id, --group, --tag, --parallel, or --auto-cancel-after-failures flag without also passing the --record flag.

Expand Down
16 changes: 10 additions & 6 deletions packages/server/lib/cloud/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ const THIRTY_SECONDS = humanInterval('30 seconds')
const SIXTY_SECONDS = humanInterval('60 seconds')
const TWO_MINUTES = humanInterval('2 minutes')

function defaultTimeout () {
return process.env.CYPRESS_INTERNAL_API_TIMEOUT && !isNaN(Number(process.env.CYPRESS_INTERNAL_API_TIMEOUT)) ? Number(process.env.CYPRESS_INTERNAL_API_TIMEOUT) : SIXTY_SECONDS
}

function retryDelays (): number[] {
return process.env.API_RETRY_INTERVALS
? process.env.API_RETRY_INTERVALS.split(',').map(_.toNumber)
Expand Down Expand Up @@ -413,7 +417,7 @@ export default {
url: recordRoutes.runs(),
json: true,
encrypt: preflightResult.encrypt,
timeout: options.timeout ?? SIXTY_SECONDS,
timeout: options.timeout ?? defaultTimeout(),
headers: {
'x-route-version': '4',
'x-cypress-request-attempt': attemptIndex,
Expand Down Expand Up @@ -487,7 +491,7 @@ export default {
url: recordRoutes.instances(runId),
json: true,
encrypt: preflightResult.encrypt,
timeout: timeout ?? SIXTY_SECONDS,
timeout: timeout ?? defaultTimeout(),
headers: {
'x-route-version': '5',
'x-cypress-run-id': runId,
Expand All @@ -507,7 +511,7 @@ export default {
url: recordRoutes.instanceTests(instanceId),
json: true,
encrypt: preflightResult.encrypt,
timeout: timeout ?? SIXTY_SECONDS,
timeout: timeout ?? defaultTimeout(),
headers: {
'x-route-version': '1',
'x-cypress-run-id': runId,
Expand All @@ -525,7 +529,7 @@ export default {
return rp.put({
url: recordRoutes.instanceStdout(options.instanceId),
json: true,
timeout: options.timeout ?? SIXTY_SECONDS,
timeout: options.timeout ?? defaultTimeout(),
body: {
stdout: options.stdout,
},
Expand All @@ -547,7 +551,7 @@ export default {
return rp.put({
url: recordRoutes.instanceArtifacts(options.instanceId),
json: true,
timeout: options.timeout ?? SIXTY_SECONDS,
timeout: options.timeout ?? defaultTimeout(),
body,
headers: {
'x-route-version': '1',
Expand All @@ -566,7 +570,7 @@ export default {
url: recordRoutes.instanceResults(options.instanceId),
json: true,
encrypt: preflightResult.encrypt,
timeout: options.timeout ?? SIXTY_SECONDS,
timeout: options.timeout ?? defaultTimeout(),
headers: {
'x-route-version': '1',
'x-cypress-run-id': options.runId,
Expand Down
Loading
Loading