Skip to content
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

fix: failing Create Instance api call no longer skips spec #30697

Merged
merged 7 commits into from
Dec 3, 2024

Conversation

cacieprins
Copy link
Contributor

Additional details

POSTing to create an instance is not idempotent.

In situations where the in-flight request is accepted by the Cloud API, but the client does not receive a response within the given timeout window, the retry attempt would create a new instance for the next spec, effectively bypassing specs.

Steps to test

The updated system tests now ensure this call is not retried; for manual testing, use Charles proxy or similar to cause a timeout on the POST runs/:id/instances request.

How has the user experience changed?

Runs will fail if the client fails to register the creation of an instance when either the --record or --parallel flag is passed. This prevents potential false negatives, where a spec skipped due to this would have failed and thus reported a test failure.

PR Tasks

cli/CHANGELOG.md Outdated Show resolved Hide resolved
@@ -188,6 +188,8 @@ export const AllCypressErrors = {

${fmt.highlightSecondary(arg1.response)}

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

Choose a reason for hiding this comment

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

Just removing the double 'because'

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

Co-authored-by: Jennifer Shehane <[email protected]>
Copy link

cypress bot commented Dec 2, 2024

cypress    Run #58617

Run Properties:  status check passed Passed #58617  •  git commit 48de0bb93a: snapshots
Project cypress
Branch Review cacie/api-call-skips-spec
Run status status check passed Passed #58617
Run duration 22m 14s
Commit git commit 48de0bb93a: snapshots
Committer Cacie Prins
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 3
Tests that did not run due to a developer annotating a test with .skip  Pending 1326
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 29400
View all changes introduced in this branch ↗︎
UI Coverage  46.24%
  Untested elements 188  
  Tested elements 166  
Accessibility  92.55%
  Failed rules  3 critical   8 serious   2 moderate   2 minor
  Failed elements 903  

count = 0
})

it('errors and does not create or update instances when parallel', function () {
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 don't make these async/await tests to help with readability?

@cacieprins cacieprins merged commit 32c7b72 into develop Dec 3, 2024
84 of 85 checks passed
@cacieprins cacieprins deleted the cacie/api-call-skips-spec branch December 3, 2024 14:52
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Dec 4, 2024

Released in 13.16.1.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v13.16.1, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Dec 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

spec is skipped if the /runs/<runId>/instances call fails
3 participants