Skip to content

Conversation

cacieprins
Copy link
Contributor

@cacieprins cacieprins commented Oct 2, 2025

Additional details

Adds 112 as a potential exit code when Cypress is run with POSIX complaint exit codes enabled (--posix-exit-codes). This exit code is used when --record or --parallel mode is unable to communicate with Cypress Cloud API due to network conditions.

Steps to test

How has the user experience changed?

PR Tasks


Note

Adds network-specific Cloud errors and exits with code 112 under --posix-exit-codes when Cloud negotiation fails; also makes API timeouts configurable and refactors run/exit handling.

  • Behavior/CLI:
    • Exit with 112 when Cloud negotiation (record/parallel) fails due to network under --posix-exit-codes.
    • Refactor startInMode to async with unified exit paths; propagate posixExitCodes; remove modes/exit.ts and inline exit-with-code logic.
  • Errors/Schema:
    • Add CLOUD_CANNOT_PROCEED_IN_PARALLEL_NETWORK and CLOUD_CANNOT_PROCEED_IN_SERIAL_NETWORK with new templates and snapshots.
  • Cloud API:
    • Make default request timeout configurable via CYPRESS_INTERNAL_API_TIMEOUT (used across run/instance/test/artifact calls).
  • Tests:
    • Add integration/system tests covering network failures, POSIX exit codes (1 vs 112), and new error outputs.
  • Docs/Changelog:
    • Update CHANGELOG.md (15.5.0) noting new exit code behavior.

Written by Cursor Bugbot for commit edcf651. This will update automatically on new commits. Configure here.

Copy link

cypress bot commented Oct 2, 2025

cypress    Run #66299

Run Properties:  status check failed Failed #66299  •  git commit edcf651d0c: Merge branch 'develop' into feat-api-failure-exit-112
Project cypress
Branch Review feat-api-failure-exit-112
Run status status check failed Failed #66299
Run duration 19m 57s
Commit git commit edcf651d0c: Merge branch 'develop' into feat-api-failure-exit-112
Committer Cacie Prins
View all properties for this run ↗︎

Test results
Tests that failed  Failures 3
Tests that were flaky  Flaky 12
Tests that did not run due to a developer annotating a test with .skip  Pending 1102
Tests that did not run due to a failure in a mocha hook  Skipped 4
Tests that passed  Passing 26705
View all changes introduced in this branch ↗︎

Warning

Partial Report: The results for the Application Quality reports may be incomplete.

UI Coverage  45.69%
  Untested elements 184  
  Tested elements 159  
Accessibility  97.97%
  Failed rules  4 critical   8 serious   2 moderate   2 minor
  Failed elements 101  

Tests for review

Failed  e2e/origin/cookie_login.cy.ts • 1 failed test • 5x-driver-firefox

View Output

Test Artifacts
cy.origin - cookie login > general behavior > handles browser-sent cookies being overridden by server-kept cookies
    </td>
  </tr></table>
Failed  commands/files.cy.js • 1 failed test • 5x-driver-firefox

View Output

Test Artifacts
src/cy/commands/files > #readFile > retries to read when ENOENT
    </td>
  </tr></table>
Failed  studio/studio.cy.ts • 1 failed test • app-e2e

View Output

Test Artifacts
Cypress Studio > updates an existing test with assertions Test Replay Screenshots
Flakiness  commands/querying/querying.cy.ts • 1 flaky test • 5x-driver-electron

View Output

Test Artifacts
... > intercept aliases > returns null if no xhr is found Test Replay
Flakiness  issues/28527.cy.ts • 1 flaky test • 5x-driver-electron

View Output

Test Artifacts
issue 28527 > fails and then retries and verifies about:blank is not displayed Test Replay Screenshots
Flakiness  commands/net_stubbing.cy.ts • 1 flaky test • 5x-driver-firefox

View Output

Test Artifacts
... > stops waiting when an xhr request is canceled
    </td>
  </tr></table>
Flakiness  e2e/origin/config_env.cy.ts • 1 flaky test • 5x-driver-firefox

View Output

Test Artifacts
cy.origin- Cypress.config() > serializable > overwrites different values in secondary if one exists in the primary
    </td>
  </tr></table>
Flakiness  issues/28527.cy.ts • 1 flaky test • 5x-driver-firefox

View Output

Test Artifacts
issue 28527 > fails and then retries and verifies about:blank is not displayed Screenshots

The first 5 flaky specs are shown, see all 12 specs in Cypress Cloud.

@cacieprins cacieprins marked this pull request as ready for review October 7, 2025 20:23
@cacieprins cacieprins marked this pull request as draft October 7, 2025 20:23
cursor[bot]

This comment was marked as outdated.

@cacieprins cacieprins marked this pull request as ready for review October 8, 2025 13:15
})
default:
return throwErr('CLOUD_UNKNOWN_INVALID_REQUEST', {
throw throwErr('CLOUD_UNKNOWN_INVALID_REQUEST', {
Copy link

Choose a reason for hiding this comment

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

Bug: Redundant Throw Causes Runtime Error

The throw throwErr(...) statement is incorrect. Since throwErr already throws an error, the additional throw keyword is redundant and will cause a runtime error.

Fix in Cursor Fix in Web

Copy link
Contributor

Choose a reason for hiding this comment

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

I have a feeling this is a TS issue?

@cacieprins cacieprins requested a review from AtofStryker October 8, 2025 13:52
return require('./errors').logException(err)
.then(() => {
debug('calling exit 1')
await require('./errors').logException(err)
Copy link
Contributor

Choose a reason for hiding this comment

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

any reason we can just import errors at the top of the file since we are starting to move away from CJS?

break
}
case 'returnPkg': {
const pkg = await require('./modes/pkg')(options)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we just import pkg from '@packages/root' at the top of the file since its a bundled package now and just reference it here instead of ./modes/pkg? Would be much simpler

break
}
case 'info': {
await require('./modes/info')(options)
Copy link
Contributor

Choose a reason for hiding this comment

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

can we just hoist this import or await import it? If not I'll likely get to this in the launcher refactor

})
})

it('errors and exits with 1 when posix exit codes are enabled', function () {
Copy link
Contributor

Choose a reason for hiding this comment

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

whats the reason the posix tests are added here and not in the posix PR? Is there some type of integration between these two I am missing?

Copy link
Contributor

Choose a reason for hiding this comment

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

oh I see its the differences between 112 vs 1 exit code

@@ -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

@jennifer-shehane jennifer-shehane self-requested a review October 8, 2025 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UX/CLI Improvement: Fatal Cy Cloud communication failure exits with a specific exit code
2 participants