-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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: adding timeout option to writeFile command #19015
Conversation
Thanks for taking the time to open a PR!
|
Test summaryRun details
View run in Cypress Dashboard ➡️ Flakiness
This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
…lue for read/write timeouts. Reverting server readFile/writeFile changes to remove explicit abort workflows.
…50-writefile-timeout
…50-writefile-timeout
…asing HTTP buffer max to node Buffer max.
152a121
…otentially impactful overhead
…ing for commands with active logs.
…50-writefile-timeout
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.
@tbiethman is there going to be a separate PR for #19142?
const verifyAssertions = () => { | ||
return Cypress.backend('read:file', file, _.pick(options, 'encoding')) | ||
return Cypress.backend('read:file', file, _.pick(options, 'encoding')).timeout(options.timeout) |
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.
So no server-side timeout?
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.
Not with this PR, no. I'm going to log a separate issue to track and evaluate how we want to handle command/server timeouts and increase the determinism of those workflows.
…50-writefile-timeout
…text * 10.0-release: (45 commits) fix: various Nav Bar fixes (#19283) build: add patch package as a dev dependency for fe-shared chore: hoist is - fun with cached dependencies build: hoist is hard build: better hoisting strategy fix: remove windows and mac workflow from branch revert: remove change about node version 17 build: remove testing of desktop-gui assets build: run window & mac CI in this branch build: more fixes build: remove toycode mdi from launchpad rename patch because of dev dep build: fix merge issue in packages generation chore: update sass for windows compatibility fix: Do not crash when a ill formed URL request is proxied (#19274) fix: remove desktop-gui from circle.yml change whitepace in patch fix: adding timeout option to writeFile command (#19015) release 9.1.1 fix: patch-package is not applied in dist'ed build (#19239) ...
User facing changelog
A
timeout
option has been added to the writeFile command, with a default value ofdefaultCommandTimeout
.The default
maxHttpBufferSize
for the internal socket server has been increased to its maximum value.Additional details
During the investigation of #3350, it was discovered that writing large files could take a long time and cause the command to fail due to a non-specific Mocha timeout error. Typically, this failure was the result of us spending a long time encoding a very large file or overflowing the maximum size of the HTTP buffer as defined by the socket server.
The writeFile command has been updated to receive an explicit timeout option to give users more direct control over the command timeouts. It also uses a custom timeout implementation rather than relying on the default Mocha timeout; this allows us to report a more accurate error message when a timeout does occur. The default timeout value remains the
defaultCommandTimeout
value from the Cypress config.The readFile command already receives a timeout option, but it is only used as part of its associated assertion retry logic. I added a custom timeout for readFile as well to ensure that we can report the appropriate error messages when the readFile command itself times out. This doesn't require a user-facing API change.
How has the user experience changed?
Old error message:
New error message:
PR Tasks
cypress-documentation
? Linktype definitions
?Have new configuration options been added to thecypress.schema.json
?