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

feat: Improve UX when Test Replay upload fails due to slow upload #30235

Merged
merged 23 commits into from
Sep 25, 2024

Conversation

cacieprins
Copy link
Contributor

@cacieprins cacieprins commented Sep 12, 2024

  • Closes

Additional details

Cypress monitors the upload of a Test Replay recording. If the upload speed drops below 102.4kbps over a period of five seconds, Cypress terminates the upload so that CI pipelines are not unnecessarily slowed. This value is determined by:

  • The default chunk size for an fs readStream is 64 kilobytes
  • The interval used to determine if an upload stream has stalled is 5 seconds
  • 64 kB * 8 = 512kb; 512kbp / 5s = 102.4kbps

This PR changes that behavior such that:

  • A non-cryptic error message is displayed, providing recommended workarounds
  • App Capture code can provide a default interval value, so this duration can be tweaked without updating the Cypress app
  • Users can override the value with an environment variable
  • Uncategorized errors that occur when uploading a Test Replay recording will display a formatted error message.

Steps to test

  • limit machine bandwidth to lower than ~102kbps and increase the sampling interval to an appropriate amount by setting the CYPRESS_PROTOCOL_UPLOAD_SAMPLING_INTERVAL environment variable. If your bandwidth is set to 56kbps, for example, you should set the sampling interval to at least ten seconds (at 56kbps, it should take just over 9 seconds to transfer 512kb, or 64 kiloBytes)
  • the upload will not be cancelled

How has the user experience changed?

A new stream stall error message:
Screenshot 2024-09-12 at 2 23 37 PM

A new uncategorized error message:
Screenshot 2024-09-12 at 2 27 41 PM

PR Tasks

Copy link

cypress bot commented Sep 12, 2024

cypress    Run #57310

Run Properties:  status check passed Passed #57310  •  git commit cf342cfc2c: changelog
Project cypress
Branch Review cacie/9143/stream-stall-enhancements
Run status status check passed Passed #57310
Run duration 25m 47s
Commit git commit cf342cfc2c: changelog
Committer Cacie Prins
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 7
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 29395
View all changes introduced in this branch ↗︎
UI Coverage  44.77%
  Untested elements 201  
  Tested elements 167  
Accessibility  91.28%
  Failed rules  5 critical   10 serious   2 moderate   2 minor
  Failed elements 944  

@cacieprins cacieprins marked this pull request as ready for review September 13, 2024 15:18
@cacieprins cacieprins requested review from AtofStryker, ryanjwilke and ryanthemanuel and removed request for ryanjwilke September 13, 2024 17:26
@ryanthemanuel ryanthemanuel merged commit 1d84532 into develop Sep 25, 2024
79 of 83 checks passed
@ryanthemanuel ryanthemanuel deleted the cacie/9143/stream-stall-enhancements branch September 25, 2024 16:39
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Sep 25, 2024

Released in 13.15.0.

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

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Sep 25, 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.

4 participants