cypress-io / cypress

Fast, easy and reliable testing for anything that runs in a browser.
https://cypress.io
MIT License
47.09k stars 3.19k forks source link

High CPU usage and DOM nodes when logs output is maximised #30658

Open alandeg opened 1 day ago

alandeg commented 1 day ago

Test code to reproduce

Any test code will show the same result, the longer the log output, the greater the impact.

There must be some sort of memory/resource usage leak when the logs viewer is maximised, as when it is minimised the number of DOM nodes and CPU usage settles

Cypress Mode

cypress open

Cypress Version

13.16.0

Browser Version

Brave Version 1.73.89 Chromium: 131.0.6778.69 (Official Build) (arm64)

Node version

18.19.1

Operating System

macOS 15.1

Memory Debug Logs

No response

Other

https://github.com/user-attachments/assets/773ea3c9-d06e-4d68-be6f-51fef43a6005

Have a look at this video which clearly shows the issue

ryanthemanuel commented 1 day ago

Hi @alandeg. Can you share your test code? I'm curious about how long the test is. Also, it appears that there are several script logs whose spinners are spinning. Do you see the # of those logs increasing over time or is it fairly constant?

alandeg commented 21 hours ago

The test code is not simple since it is part of a much larger test suite, so I would say it's not possible to share it in it's entirety here. I can try to replicate using a simpler example and share it here.

Regarding your other question, it looks like the number of DOM nodes being created is quite constant when the logs viewer is open, it could very well be due to the number of spinner animations present, since this particular test is quite a long one to finish running. Do you know why the spinners remain animating? Even after the test has completed, as with this case