-
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 slows down and then crashes during cypress run #3829
Comments
I split all of my tests into separate files. Each file has one The more I think about it, I thing the memory leak is coming from my custom command... If the custom command holds the references to the objects between renders, then that would for sure cause a problem... |
Here's an example command: Cypress.Commands.add(
"flushTransactions",
{ prevSubject: "optional" },
subject => {
cy.window()
.then(async win => {
const LocalTransactionQueue = win["LocalTransactionQueue"]
await timeout(200)
await LocalTransactionQueue.drain()
})
.then(() => subject)
}
) The |
I replaced all logic that accesses the window with waits... still runs out of memory and crashes... Cypress.Commands.add(
"flushTransactions",
{ prevSubject: "optional" },
subject => {
cy.wait(1000)
.then(() => subject)
}
) |
I removed all custom commands. Still runs out of memory and crashes. Everything I'm using Cypress vanilla command with Typescript now... |
Its also worth mentioning that this is a problem on both Chrome and Electron |
Hmm. I guess maybe this is expected? |
After adding the |
Looks like Docker is still crashing in CircleCI though...
|
Looks like there's plenty of shared memory... |
I believe there could be issues when you run a lot of tests in GUI mode. How many tests are we talking here? |
8 tests. Takes a total of 10 minutes to run. |
Still crashes in headless mode though. I split all 8 tests into separate files and things seems to be working fairly reliably at the moment... |
Hello! I have the same problem. I run 25 tests (12 files) with Chrome on my local machine. Whole execution takes about 12 minutes (estimated from running them all separately). Cypress starts to slow down circa about 8 minutes after start, then crashes. |
Hmm now that I think about it, the other day I read about someone having issues with snapshots because of very large css files. #2366 Could this be related to your issues? |
Hmm. No, but we have about 4MB of gzipped javascript... |
Adding |
What is interesting to me is that I find that running |
My test suite of about 50 tests crashes each other run when with Electron browser. Works fine with chrome. In logs it just says it crashed |
We've been trying to recreate this with no success. We believe this is happening and just want to track down why. If you are having crashing issues during Please can anyone provide the test code to run to reproduce the situation where running multiple tests slows down and eventually crashes while running in |
Happens for me as well by docker. |
I understand that this might be hard to replicate as these tests are client specific but I'm observing the exact same behaviour with my instance. Currently running a bunch of Jira UI tests on CircleCI and this simply grinds to a halt after a while. Same goes for |
@jennifer-shehane see #1906 (comment) on how to reproduce the problem |
Seem to be having the same issue. Cypress._.times(200, (i) => {
it(`num ${i + 1} - test the thing conditionally`, () => { The test runs well for the first 125 times and takes about 13 sec to complete. Hope this sheds some light on reproducing the issue. |
I'm having the exact same issues ad described above and I am running Cypress in Scrutinizer. Last test always grinds to a halt (never passes) with the following output. The steps files are Typescript and I'm using the
Next to that I get the following stack trace:
As it is kind of hard to make this error reproducible (due to private repo). What I can do is share the test that is failing, but as you'll see there's nothing exciting there... feature file Feature: Page not found
I want to be notified when a page does not exist
Scenario: Display the page not found page
Given I navigate to a page that does not exist
Then I should see a notification that the page is not found step definition import { Given, Then } from 'cypress-cucumber-preprocessor/steps';
import { testHooks } from 'src/testing/testHook';
Given('I navigate to a page that does not exist', () =>
cy.visit('http://localhost:3000/a-non-existant-page')
);
Then('I should see a notification that the page is not found', () => {
cy.getById(testHooks.NotificationPage).contains('Page not found');
}); Where the getById command is simply a wrapper around get Cypress.Commands.add('getById', testHookId =>
cy.get(`[data-test-id="${testHookId}"]`, { timeout: 20000 })
); |
It has been 5 months with no progress on this issue. I would not rely on Cypress fixing this issues. I've moved my company on to using the For now, I'm going to close this issue because it is not making progress and is giving people a false sense of hope. |
I am also of the same opinion and finding hard to go back to other tool after investing lot of time and still there is no light in this darkness.... There is no option and just to move away from this. I also their efforts but we cannot reply on this type of feature or support. It has been 3 years this bug has been reported and still people are struggling to overcome with this problem. |
@srinu-alef and anyone else struggling with this, I've been using Selenium without any issues for months now. I created a monadic API similar to Cypress that is easy to use and easy to migrate over. Please feel free to use it and spread the word: https://gist.github.com/ccorcos/5372e1f946927d5043f070fb9260fcea |
I'm having constant issues with Cypress freezing on my AWS Workspace. It just started happening a couple weeks ago. It cases tests to fail due to timeout. Is this being worked on? |
They've constantly avoided addressing this issue. The gist I mentioned here is almost a drop-in replacement that uses Selenium instead. |
@ccorcos We have not been avoiding this issue. We cannot begin work on an issue where we have not been given a reliable way to reproduce - which no one has provided. We have thousands of tests and also performance tests, so when these issues arise it is very likely an edge case involving something specific to your tests, your application under test or environment. We need to be able to replicate this completely in order to address it. @craig-dae @srinu-alef @Frituurpanda @idanRiski For anyone else experiencing a 'slow down/crash', open a new issue with a completely reproducible example since the original author has closed this issue. We really want to fix performance issues. They are high priority for us. @marinakuranda I am not able to detect any slowdown in Cypress in 3.8.1 with your example. Video below. Please provide more detail if necessary (for example, does this only happen in cypress run) @LeroyDoornebal Thanks for the detail, unfortunately this example cannot be run on our machines so cannot be verified by us. @scharf You mentioned in your comment that the link is how to 'reproduce the problem', but you provided zero test code for us to run to reproduce the problem. Can you please open a new issue with the test code required to run to see the performance issues you've described. |
@jennifer-shehane I can't reproduce reliably. It started happening sometime in the past few weeks. We wrote about half a dozen integration tests on a new project before it started happening. I'll run a test manually, using the UI. It's a coin-flip whether it freezes or runs smoothly. It will usually freeze when the app is loading initially. It will freeze less often, after the preloading animation, somewhere usually near the beginning of the tests. It will usually complete the test if gets through maybe the first 25% of the test. It will sometimes freeze for 10s and then unfreeze. This causes the test to fail due to timeout. It usually freezes long enough for me to grow impatient and kill it. I'll then go back to the cypress UI, select the test, and run it again, and it's another coin-flip as to whether it gets through. This is not me doing hundreds of tests. This is freezing when I run one single test. The test clicks a few buttons and fills out a form. The most complicated thing in it is I have not seen the test fail when I do I'm testing an Angular project, if you think that might be relevant. Please advise on what else I can do to help you with this. I can open a new ticket if that helps. |
@jennifer-shehane I'm going to open a new ticket with what I wrote above. If I could reproduce the problem reliably, I would. I'll need you to help me go through some troubleshooting steps. |
@craig-dae Ok, also make sure to check out and isolate whether this is an existing performance issue that is a bug in Chrome 79 here: #6023 (comment) |
@jennifer-shehane I think that the issue on this page is different from the other thread that I started. I don't have the problem with I am confident that the issue is with Chrome 79, and not with Cypress, for my issue. Thanks! |
@nzn-idt where can I find that file |
Assuming a Windows installation Cypress\ is the directory containing your Cypress.exe file (i.e. the topmost level). |
for me, a good solution was to turn off video recording and compressing ( |
Cypress seems to slow down/freeze, when I open the chrome(V84) dev tools. |
I just updated to 5.4.0 and mine are working again (but i also closed dev tools). not sure for how long though, definitely a memory leak somewhere |
Hey there, I'm new to Cypress and things we going well, but now things are starting to crash now that I have a larger test suite. I've noticed that this sort of issue was filed a bunch of times before (#431) but I'm just not sure what I should be doing to fix the issue...
Current behavior:
Here's an error report from Terminal when running with Electron 59. Things started to get pretty slow before it completely died.
Those constructors are objects in my code. I don't think there's a memory leak in my application code. I have a few custom commands that access some objects off of the
window
but I'm navigating around which should garbage collect everything. Not sure what Cypress is doing internally... Maybe its keeping everything around?Also, happy to try whatever you want to see if we can get this working 👍 I really like everything else about Cypress!
Versions
ProductName: Mac OS X
ProductVersion: 10.14
BuildVersion: 18A391
Cypress: 3.1.5
The text was updated successfully, but these errors were encountered: