-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Out of memory issue after update a browsers to version 104+ (Chrome&Edge) #23391
Comments
Also seeing the same issue, no major code changes (nothing that would cause any sort of memory leak) and only the updated versioning of browsers. Debugging was always an issue for us with memory crashes but now we are seeing every agent failing to run a test in our azure pipelines due to what we suspect now is a memory issue with the chrome browser being used. Switched to Electron in the same pipeline and we had no issues |
I'm having the same issue with chrome 104 and chrome 105 beta, edge and other latest chromium versions. |
I'm having the same issue. What I try to do at the moment is to atomize as much as possible each spec, by making spec change it seems that the memory is "reset" and the problem does not occur, but even if there is only one test case and it is too long, the problem will occur. The most tedious thing is that it doesn't jump any error, it just freezes. |
Following up with a conversation on the Cypress Discord server, My longest spec is 50+ test cases, some of which are individually 50+ lines long for reference, in case spec size is a factor. If there's any further info I can provide please let me know. |
Same issue, chrome 104, same with electron, same like previous versions of cypress or browsers:
Tried every option available in github issues such as:
It would be nice if we could config chrome at least to take up more memory from the computer. :( PS: Headless is not affected, only headed runs. |
Hi @MusolQA ! Thank you for reporting this issue, I'm sorry to hear you and others are running into this problem. In order to investigate, we'll need to be able to reproduce on our end. Can you set up a cypress-tiny-test that reproduces the issue? Thanks |
Thanks for your answer. Here repository with code that causes Out of memory issue. To run please install dependencies (preprocessor to run BDD), and run test.feature file. Below my results. I add a bunch of When, Then steps in feature file, but basically its failing after ~2-3 mins of each scenario execution. |
Btw. I can see that similar issue was reported and solved in January, here: #17853 |
@MusolQA That was reported by me, and it's not the same issue. Issue#17853 was caused due to changes in cypress 8.2 and above while this new issue is caused due to changes in memory usage for Chrome 104 and 105 beta. |
it is due to the new browser versions. I didn't change anything in my code but after the browser update to Chrome 104, many test specs crashed. I downgraded to Chrome 102 and the problems stopped. |
Yes, definitely problem is between cypress and latest chromium relation. However you know, downgrade the browsers version might be workaround for few days, but tests should be run on latest version to be reliable. |
Same issue here |
See one of the several issues that have been reported on google support for chrome 104 memory. |
@rachelruderman any update or progress? |
i don't think it's Cypress, but a problem with the Chrome browser, as you can see one post above. |
And it's final answer? Due to this chrome change and limitation we cannot run tests with take more 2mins on Chrome/Edge? |
At least Cypress should fail the test case when the memory problem occurs. At this point it just hangs. |
Potentially relevant Chromium issue: https://crbug.com/1353749 Edit: and another one: https://crbug.com/1352649 |
Hi @MusolQA , thank you for creating the cypress-tiny-test repro! I ran it on my personal machine (Mac OS) with Chrome 104 and it passed. Can you tell me a bit more about your Windows Azure Virtual Machine? What OS version are you on and how much memory does it have? TIA! |
@rachelruderman , Thanks. Below our Azure VM configuration:
|
Update: After update to Chrome 105, same issue. |
@JessefSpecialisterren wrote
This is becoming a bit of a nightmare. Up until version 12 I could at least get our tests to run through by forcing Cypress to use Chrome 99. With version 12 not even that browser works. I cannot get our tests to complete without OOM errors in any browser at all......which kinda rules V12 out for us for the foreseeable. |
So as per previous conversations it looks like while using the GUI via "cypress open", on any browser, Chrome, Firefox, Edge, etc.. The memory used by the browser instance does not go down after finishing a test. Because this happens on multiple browsers all the same way this would seem to be pretty isolated to Cypress itself causing the issue as opposed to a Chromium version memory leak issue. Is there any way to reset memory usage for the instance while having it active? @mschile |
@kpturner wrote
Interesting! We switched to Cypress 12 last week and haven't had a single OOM problem in our CI runs with Chromium 99 so far. This issue seems to be remarkably hard to pin down 🤔 For the record: does "any browser at all" include Firefox? |
It's only newer browsers, or at least is only particularly prominent in newer browsers. We've had to keep our CI browser tagged at around Chromium 102 to keep our tests running while the Cypress team try and figure out this problem. |
Yes it includes Firefox but I have not tried all different versions of Firefox. It’s just not practical to try every version of every browser so I can’t say all versions of FF fail in the same way. I’m considering splitting our test suite in two as some sort of workaround - but this situation is not good. Firefox fails in a different way: |
If only that were true |
@kpturner, could you please log a new issue for Firefox since this one pertains to Chromium browsers. You can try forcing garbage collection in Chromium based browsers by adding the following in your support file:
|
@mschile I will give that a try. However I have tests that crash chrome (using the GUI) after just two tests have run. I am almost at the point of trying this for every test - no idea how much it will impact performance though. My Firefox comment was just to answer the question posed to me (had I tried it). I will log an issue later but I don't want to do so without all the baggage that goes with doing so. At the moment I need to firefight the Chrome problem as a priority. |
@kpturner, if you are getting OOM after a few tests in open (GUI) mode, I would also suggest setting |
We have always used that setting because we have always had issues. Unfortunately with V12 it makes no difference. The chrome browser crashes every time we run certain tests. |
Tried this overnight. Unfortunately same result |
Well after much pain and trial and error it turns out that I was able to return our tests (on Chrome 99 at least) back to normal simply by setting |
So, rather astonishingly, our OOM issues have been completely tipped on their head simply by setting |
Unfortunately, the Besides, this issue seems to be related to (if not a duplicate of) #24905 |
The code for this is done in cypress-io/cypress#25462, but has yet to be released. |
What code are we talking about? Has the memory leak been found and fixed or are we relying on the setting that forces garbage collection? The latter didn't help (in our case). |
Hi @kpturner , during our investigation we found that Cypress was preventing chromium browsers from running their GC normally since there was no periods of inactivity. This new approach has Cypress monitor memory usage and calling for GC when appropriate. This does not address any potential memory leaks that may exist (we do not know of any current ones but that does not mean they can't exist). We are planning to focus on performance and resource utilization throughout 2023, so more to come on that front in the future. If this new flag does not address your issue, I would ask that you please open a new ticket for your specific issue so that we can investigate that specific use case (which may have details that unearth some new findings). Thank you. |
Yes we tried the experimental garbage collection step - every 5 tests and indeed on every test and Chrome still crashed. For us, simply reverting to having I didn't see any other feedback on here to suggest that the garbage collection option helped others. Did I miss something? Closing the issue would suggest it is fixed for everyone else? |
from what I've been seeing this problem has multiple layers, one of those was gc not being able to do it's just. That is addressed in this PR. An other thing that I found is that during long running tests that the command log is not being purged. This can be thought of a memory leak light, because it is an intended behaviour, just for a long run those entries can add up. This should be addressed in this ticket: #25230 |
Current behavior
We have configured build to run UI tests on both Edge and Chrome browsers.
Last time I noticed that on Edge test are not executed and finished after 6h (pipeline timeout).
Now we have the same situation on Chrome, that test are not executed.
Without any error/log etc.
What interesting both starting to timeout after update Edge from version 103 to 104 and Chrome from version 103 to 104.
No any code changes between update from 103 to 104, so same code base failing after update to 104.
I run it locally and always have "Out of memory" issue screen during execution. --headed flag added to investigate
I try it on different versions, and always have same issue.
Desired behavior
Same code should working on browsers version 103 and 104.
Test code to reproduce
No any code, test are not running, because of out of memory issue.
Cypress Version
9.3.1, 9.7.0, 10.0
Node version
16.16.0
Operating System
Windows Azure Virtual Machine
Debug Logs
No response
Other
No response
The text was updated successfully, but these errors were encountered: