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

Cypress crashes when using readFile / selectFile on extremely large files (~1gb) #20244

Open
BlueWinds opened this issue Feb 17, 2022 · 7 comments
Labels
pkg/driver This is due to an issue in the packages/driver directory prevent-stale mark an issue so it is ignored by stale[bot] type: bug

Comments

@BlueWinds
Copy link
Contributor

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

@sainthkh sainthkh added pkg/driver This is due to an issue in the packages/driver directory stage: ready for work The issue is reproducible and in scope labels Mar 7, 2022
@cypress-bot cypress-bot bot added stage: backlog and removed stage: ready for work The issue is reproducible and in scope labels Apr 29, 2022
@lu-moreno23
Copy link

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!

@cypress-app-bot
Copy link
Collaborator

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.

@cypress-app-bot cypress-app-bot added the stale no activity on this issue for a long period label Sep 17, 2023
@adamalston
Copy link

I am still encountering this issue.

@cypress-app-bot cypress-app-bot removed the stale no activity on this issue for a long period label Sep 24, 2023
@nagash77 nagash77 added the Triaged Issue has been routed to backlog. This is not a commitment to have it prioritized by the team. label Sep 25, 2023
@pesterhazy
Copy link

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

@pesterhazy
Copy link

That's on 6.6.0 (I know that's old)

@jennifer-shehane jennifer-shehane added type: bug and removed Triaged Issue has been routed to backlog. This is not a commitment to have it prioritized by the team. labels Dec 17, 2023
@jennifer-shehane jennifer-shehane added the prevent-stale mark an issue so it is ignored by stale[bot] label May 24, 2024
@mmestas
Copy link

mmestas commented May 28, 2024

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. "File size (2281403699) is greater than 2 GiB"

@jennifer-shehane
Copy link
Member

@mmestas Where are you seeing this error printed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg/driver This is due to an issue in the packages/driver directory prevent-stale mark an issue so it is ignored by stale[bot] type: bug
Projects
None yet
Development

No branches or pull requests

9 participants