-
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
Cypress crashes when using readFile / selectFile on extremely large files (~1gb) #20244
Comments
Hey! I'm wondering if there's some sort of update related to this? I've been experiencing this myself and it's becoming really painful to try read files with this issue going on :( I really appreciate any type of information you can provide about it! Thanks! |
This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided. |
I am still encountering this issue. |
We're seeing this issue with a much smaller file size – PDF file of 5.2M (not G) Seems like it crashes the browser or something like that, as the regular timeout doesn't seem to kick in |
That's on |
I reported a slightly different, but similar issue and it got closed as a duplicate of this issue. My issue is that Cypress simply throws an error (it does't crash the browser) when the file I'm trying to upload is larger than 2gb. |
@mmestas Where are you seeing this error printed? |
Current behavior
We have user reports that using readFile or selectFile with extremely large files (in the gigabyte range) causes the browser to crash. See also #7365.
This seems likely due to the fact that we read files into memory and pass them to the browser as a single monolithic chunk - to pass along a 1gb file, we first read 1gb into memory in the server, then put the whole thing in a websocket message to pass to the browser, which also stores it in memory.
Javascript best practice for dealing with files in general - and large files in particular - is to stream them. While we can't properly stream them over a websocket, and our command design requires that we eventually store the whole file in memory, we can reduce the potential for issues by at least passing around the data in smaller chunks. 100mb websocket messages are less likely to crash the browser than 1gb websocket messages.
Desired behavior
Cypress does not crash when dealing with very large files, or at least provides some indicator of progress.
Test code to reproduce
No code at this time. Just opening an issue to point to when discussing large file problems.
Cypress Version
9.5.0
Other
No response
The text was updated successfully, but these errors were encountered: