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

writeFile cannot handle big payloads (~100MB+) #17903

Closed
muhammad-st opened this issue Aug 26, 2021 · 4 comments
Closed

writeFile cannot handle big payloads (~100MB+) #17903

muhammad-st opened this issue Aug 26, 2021 · 4 comments
Labels
stale no activity on this issue for a long period type: bug

Comments

@muhammad-st
Copy link

muhammad-st commented Aug 26, 2021

Current behavior

When cy.writeFile is called with 100MB+ of text it hangs forever. also when I try to inspect the websocket in chrome browser (in that case) the whole browser freezes.

Desired behavior

cy.writeFile should either handle big payloads or have some explicit limitations.

Test code to reproduce

describe('big file spec', () => {
  it('should fail', () => {
    cy.visit('https://www.google.com');
    cy.writeFile('./text.txt', 'x'.repeat(100*1024*1024));
  });
});

Cypress Version

8.3.0

Other

tried to use a task and faced the same result, since it seems to be failing to send the serialized args (in case of big payloads).

@jennifer-shehane
Copy link
Member

Yah there's something not being handled correctly with writeFile. This is strange considering this used to be the behavior: #3350 So something may have changed.

@walkerburgin
Copy link

We're seeing issues with writeFile() and ~100mb files as well (electron, cypress@8.0.0). For us it's manifesting as the Electron process OOM'ing and crashing.

I'm not sure if it's relevant or helpful, but even just creating a similarly sized Buffer will reliably crash the process. This starts failing somewhere in between 100 and 125mb:

describe("Big buffer spec", () => {
    it("should fail", () => {
        console.log(" >>> Big buffer: " + Buffer.from("x".repeat(125 * 1024 * 1024)).length);
    });
});
┌─────────┬───────────────────┬──────────────┬──────────────────────────────────────┬────────────┬────────────────┬──────────┬──────────────┬─────────────┐
│ (index) │       group       │ processCount │                 pids                 │ cpuPercent │ meanCpuPercent │ memRssMb │ meanMemRssMb │ maxMemRssMb │
├─────────┼───────────────────┼──────────────┼──────────────────────────────────────┼────────────┼────────────────┼──────────┼──────────────┼─────────────┤
│    0    │    'Electron'     │      1       │              '1617654'               │    7.17    │       5        │  759.84  │    401.3     │   1180.23   │
│    1    │     'cypress'     │      1       │              '1617118'               │    2.48    │      3.23      │  276.01  │    266.52    │   286.26    │
│    2    │     'plugin'      │      1       │              '1617483'               │     0      │      3.55      │  271.29  │    211.41    │   271.29    │
│    3    │ 'electron-shared' │      4       │ '1617122, 1617303, 1617123, 1617455' │    0.46    │      0.39      │  255.32  │    239.59    │   255.32    │
│    4    │     'ffmpeg'      │      1       │              '1617649'               │     0      │      0.01      │  13.36   │    11.24     │    13.36    │
│    5    │      'other'      │      2       │          '1619759, 1619760'          │     0      │       0        │   3.63   │     3.66     │    3.75     │
│    6    │      'TOTAL'      │      10      │                 '-'                  │   10.11    │     11.03      │ 1579.45  │   1049.46    │   1999.3    │
└─────────┴───────────────────┴──────────────┴──────────────────────────────────────┴────────────┴────────────────┴──────────┴──────────────┴─────────────┘

<--- Last few GCs --->

[1617654:0x382500000000]     9429 ms: Scavenge 600.3 (614.6) -> 592.6 (614.6) MB, 0.2 / 0.0 ms  (average mu = 0.894, current mu = 0.862) allocation failure
[1617654:0x382500000000]     9437 ms: Scavenge 600.3 (614.6) -> 592.6 (614.6) MB, 0.1 / 0.0 ms  (average mu = 0.894, current mu = 0.862) allocation failure
[1617654:0x382500000000]     9444 ms: Scavenge 600.3 (614.6) -> 592.6 (614.6) MB, 0.1 / 0.0 ms  (average mu = 0.894, current mu = 0.862) allocation failure


<--- JS stacktrace --->

@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
@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 May 15, 2023
@cypress-app-bot
Copy link
Collaborator

This issue has been closed due to inactivity.

@cypress-app-bot cypress-app-bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale no activity on this issue for a long period type: bug
Projects
None yet
Development

No branches or pull requests

4 participants