Memory leak in long running single test
See original GitHub issueCurrent behavior:
Currently if a test runs the same actions repetitively over a long period of time, the memory of the cypress process increases until it crashes. (headless mode, video off, numTestsKeptInMemory 0) The sample to reproduce runs 15 minutes increasing the memory ~300MB. (the longer the run the more memory is used…)
Desired behavior:
Performance tests should be possible with cypress, without increasing memory and crashing.
Steps to reproduce: (app code and test code)
Config cypress.json
{
"baseUrl": "http://localhost:8080/",
"defaultCommandTimeout": 60000,
"viewportWidth": 1280,
"viewportHeight": 720,
"numTestsKeptInMemory": 0,
"video": false
}
Cypress test
describe('memory dummy test', () => {
const endTime = Date.now() + 60000 * 15;
before('visit', () => {
cy.visit('/memory-test.html');
});
it('should test', () => {
const test = () => {
cy.get('#testinput').clear().type('hello world');
cy.wait(2000);
cy.then(() => {
if (Date.now() < endTime) test();
});
};
test();
});
});
Simple static html site
<!DOCTYPE html>
<html lang="en">
<head>
</head>
<body>
<input id="testinput">
</body>
</html>
Versions
Cypress 3.2.0 / 3.5.0 / 3.6.0 Windows 10
Issue Analytics
- State:
- Created 4 years ago
- Reactions:20
- Comments:33 (7 by maintainers)
Top Results From Across the Web
Finding the cause of a memory leak in Jest tests
Memory leaks can be nasty and pretty hard to find. We found that the hard way. We should always make sure to clean...
Read more >Your Jest Tests are Leaking Memory
That is, until you add one more test and suddenly the suite comes apart. In this article, we'll walk through why it's so...
Read more >Memory leak detection - How to find, eliminate, and avoid
The simplest way to detect a memory leak is also the way you're most likely to find one: running out of memory. That's...
Read more >Memory Leak Testing in Continuous Integration Systems
While developers may routinely run their own memory tests on the code they are actively developing, memory testing later in the development ...
Read more >Memory leak detection while running unit tests - Stack Overflow
To obtain this sort of information, we override new/delete and malloc/free, providing our own heap implementations that store stacktraces on allocation and ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Any update on memory leak
same problem 9.6.1