question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Snapshotting still occurs when numTestsKeptInMemory is 0

See original GitHub issue

Current behavior:

When running cypress in GUI mode with numTestsKeptInMemory set to 0, snapshotting still occurs even though none of them should be kept in memory. This has a negative impact on performance and memory consumption.

In this screenshot, you can see that numTestsKeptInMemory is 0, but 5 seconds is spent taking snapshots that will not be used.

Screen Shot 2019-05-03 at 12 35 28 PM

In this screenshot you can see where the majority of the snapshot execution took place, 3.4s converting rules from large stylesheets into a string, and 0.4s replacing URLs in those strings with absolute paths.

Screen Shot 2019-05-03 at 12 40 53 PM

Desired behavior:

When running with numTestsKeptInMemory set to 0, snapshotting should be avoided in the same way that occurs while running in headless mode.

Steps to reproduce:

  1. Set numTestsKeptInMemory to 0.
  2. Run cypress GUI mode.

Versions

Cypress: 3.2.0 Chrome: Chrome 74

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
brian-manncommented, May 17, 2019

I’ll take this PR from here and we’ll get it out in the next patch release or so.

1reaction
jennifer-shehanecommented, May 3, 2019

Hey @CoryDanielson, can you take a look at your resolved configuration and confirm that the numTestsKeptInMemory configuration is being read as set to 0? https://on.cypress.io/configuration#Resolved-Configuration

Read more comments on GitHub >

github_iconTop Results From Across the Web

cypress-io/cypress - Gitter
well setting numTestsKeptInMemory to 0 will prevent the snapshot from being stored... but there could be many other things that consume memory. sun-stream....
Read more >
Cypress long automation script crashes the Chrome browser ...
At 0 you will not get any DOM snapshots. The memory usage will still climb, but it will climb at a much slower...
Read more >
Configurations in Cypress and How to Disable Default ...
numTestsKeptInMemory, 50, This configuration specifies the number of tests for which we keep the snapshots and the command data in memory.
Read more >
Configuration - Cypress Documentation
numTestsKeptInMemory, 50, The number of tests for which snapshots and command ... between 0 and 51 , where a lower value results in...
Read more >
Scheduled & distributed Cypress tests for multiple ... - habx
baseUrl}} numTestsKeptInMemory=0 ... We still had bugs that did occur in production, mostly because of a different set of data, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found