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.

cypress run occasionally crashes with node OOM errors

See original GitHub issue

Current behavior:

<--- Last few GCs --->

[902:0x14d4055f4000]  1414367 ms: Mark-sweep 2050.4 (2142.6) -> 2050.4 (2142.6) MB, 2327.2 / 0.0 ms  allocation failure GC in old space requested
[902:0x14d4055f4000]  1416781 ms: Mark-sweep 2050.4 (2142.6) -> 2050.4 (2141.6) MB, 2414.3 / 0.0 ms  last resort 
[902:0x14d4055f4000]  1418947 ms: Mark-sweep 2050.4 (2141.6) -> 2050.4 (2141.6) MB, 2165.5 / 0.0 ms  last resort 


<--- JS stacktrace --->

==== JS stack trace =========================================

Security context: 0x2fbf9512d681 <JSObject>
    2: stringSlice(aka stringSlice) [buffer.js:556] [bytecode=0x193b5ab7ca49 offset=96](this=0x10df42502311 <undefined>,buf=0x334eb421b249 <Uint8Array map = 0x2c7df00ceb21>,encoding=0x2fbf9513e8a9 <String[4]: utf8>,start=0,end=404259)
    4: toString [buffer.js:629] [bytecode=0x193b5ab7c681 offset=151](this=0x334eb421b249 <Uint8Array map = 0x2c7df00ceb21>,encoding=0x2fbf9513e8a9 <String[4]: utf8...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: node::Abort() [/root/.cache/Cypress/3.0.1/Cypress/libnode.so]
 2: 0x7faa08f32887 [/root/.cache/Cypress/3.0.1/Cypress/libnode.so]
 3: 0x7faa08aa1a57 [/root/.cache/Cypress/3.0.1/Cypress/libnode.so]
 4: 0x7faa08aa19d5 [/root/.cache/Cypress/3.0.1/Cypress/libnode.so]
 5: v8::internal::Factory::NewRawTwoByteString(int, v8::internal::PretenureFlag) [/root/.cache/Cypress/3.0.1/Cypress/libnode.so]
 6: v8::internal::Factory::NewStringFromUtf8(v8::internal::Vector<char const>, v8::internal::PretenureFlag) [/root/.cache/Cypress/3.0.1/Cypress/libnode.so]
 7: v8::String::NewFromUtf8(v8::Isolate*, char const*, v8::NewStringType, int) [/root/.cache/Cypress/3.0.1/Cypress/libnode.so]
 8: node::StringBytes::Encode(v8::Isolate*, char const*, unsigned long, node::encoding, v8::Local<v8::Value>*) [/root/.cache/Cypress/3.0.1/Cypress/libnode.so]
 9: 0x7faa08f4e5d8 [/root/.cache/Cypress/3.0.1/Cypress/libnode.so]
10: 0x7faa08a71550 [/root/.cache/Cypress/3.0.1/Cypress/libnode.so]
11: 0x7faa088dfd98 [/root/.cache/Cypress/3.0.1/Cypress/libnode.so]
12: 0x7faa088df30e [/root/.cache/Cypress/3.0.1/Cypress/libnode.so]
13: 0x67697b843fd

Desired behavior:

No crash

Steps to reproduce:

circleci 2.0 config chrome67-ff65 docker img cypress-typescript-preprocessor 100 spec files

Versions

Cypress 3.0.1 Running chrome67-ff65 docker image on CircleCI 2.0 Ubuntu 16.04

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:15 (5 by maintainers)

github_iconTop GitHub Comments

6reactions
shinobi64commented, Oct 20, 2018

I’ve run now into the same issue - Cypress 3.1.0, Mac OS X 10.13.6, Electron 59 The issue occurs while running a suite which contains of two tests. In the second test on the same request it fails with

<— Last few GCs —>

[83531:0x7fe0d680bc00]    57174 ms: Mark-sweep 2046.6 (2157.3) -> 2046.6 (2157.8) MB, 159.9 / 0.5 ms  allocation failure GC in old space requested
[83531:0x7fe0d680bc00]    57398 ms: Mark-sweep 2046.6 (2157.8) -> 2046.6 (2123.8) MB, 223.6 / 34.7 ms  last resort 
[83531:0x7fe0d680bc00]    57604 ms: Mark-sweep 2046.6 (2123.8) -> 2046.6 (2122.3) MB, 205.4 / 33.0 ms  last resort 

<— JS stacktrace —>

==== JS stack trace =========================================

Security context: 0x2628cba4b5d1 <Window map = 0x2fd68238cd89>
    2: replace(this=0x170eef7dd8e9 <Very long string[857083]>,0x3e6fee24e431 <JSRegExp <String[23]: url\((['"])([^'"]*)\1\)>>,0x170eef7dd971 <JSFunction (sfi = 0x48f53597449)>)
    3: makePathsAbsoluteToStylesheet [http://localhost:4444/__cypress/runner/cypress_runner.js:~61447] [pc=0x2e42e426b914](this=0x2d94465b28c9 <JSGlobal Object>,styles=0x170eef7dd8e9 <Very long string[8...

Memory statements from CYPRESS_MEMORY=1 did not show a significant increase and as well no direct shortage of memory

memory info { rss: 238333952,
  heapTotal: 129863680,
  heapUsed: 116772008,
  external: 676034 }
memory info { rss: 232624128,
  heapTotal: 126193664,
  heapUsed: 114479928,
  external: 438446 }
memory info { rss: 232689664,
  heapTotal: 126193664,
  heapUsed: 114558776,
  external: 439619 }

The third info was taken after the last request was send - and directly after that the GC statement showed up.

After setting video:false in the configuration there was no change to the behavior. Same for the configuration option numTestsKeptInMemory a reduction from the default value to e.g. did not provided a different result.

We’re not running typescript - plain javascript tests.

3reactions
TLaddcommented, Aug 11, 2018

Since you’re using typescript too, it might be the same issue as https://github.com/cypress-io/cypress/issues/2316

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fixing Cypress errors part 1: chromium out of memory crashes
Error: Out of memory, chromium renderer crashed · Solution 1: Use --ipc=host Docker flag · Solution 2: Use --disable-dev-shm-usage Cypress flag.
Read more >
Cypress Test Failing With "Out Of Memory" Error In ... - ADocLib
cypress-gh-action-small-example, Runs tests and records them on Cypress Dashboard. cypress run occasionally crashes with node OOM errors #1955 (2141.6) -> ...
Read more >
Introduction to Cypress - Cypress Documentation
In Cypress there is no built in error recovery from a failed command. A command and its assertions all eventually pass, or if...
Read more >
Resolving Out-of-Memory Issues - Gatsby
Occasionally larger Gatsby sites, or moderately-sized sites with unusual characteristics, run into out-of memory errors during gatsby build…
Read more >
JavaScript Heap Out Of Memory Error | Felix Gerschau
By default, Node.js has memory limits that prevent the program from consuming too much memory and crashing the whole system. The results differ ......
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