-
Notifications
You must be signed in to change notification settings - Fork 3.4k
feat: exit with code 112 when api errors prevent cloud orchestrated runs (record mode, parallel run mode) #32635
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
base: develop
Are you sure you want to change the base?
Conversation
cypress
|
Project |
cypress
|
Branch Review |
feat-api-failure-exit-112
|
Run status |
|
Run duration | 19m 57s |
Commit |
|
Committer | Cacie Prins |
View all properties for this run ↗︎ |
Test results | |
---|---|
|
3
|
|
12
|
|
1102
|
|
4
|
|
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%
|
|
---|---|
|
184
|
|
159
|
Accessibility
97.97%
|
|
---|---|
|
4 critical
8 serious
2 moderate
2 minor
|
|
101
|
Tests for review
e2e/origin/cookie_login.cy.ts • 1 failed test • 5x-driver-firefox
}) | ||
default: | ||
return throwErr('CLOUD_UNKNOWN_INVALID_REQUEST', { | ||
throw throwErr('CLOUD_UNKNOWN_INVALID_REQUEST', { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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?
return require('./errors').logException(err) | ||
.then(() => { | ||
debug('calling exit 1') | ||
await require('./errors').logException(err) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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 () { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 @@ | |||
[31mWe encountered an unexpected error communicating with our servers.[39m |
There was a problem hiding this comment.
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
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
cypress-documentation
? docs: Adds documentation for the112
exit code when posix-compliant exit codes are enabled. cypress-documentation#6294type definitions
?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.
112
when Cloud negotiation (record/parallel) fails due to network under--posix-exit-codes
.startInMode
to async with unified exit paths; propagateposixExitCodes
; removemodes/exit.ts
and inline exit-with-code logic.CLOUD_CANNOT_PROCEED_IN_PARALLEL_NETWORK
andCLOUD_CANNOT_PROCEED_IN_SERIAL_NETWORK
with new templates and snapshots.CYPRESS_INTERNAL_API_TIMEOUT
(used across run/instance/test/artifact calls).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.