Skip to content
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 run crashes after last test #3073

Closed
fr0 opened this issue Jan 7, 2019 · 5 comments
Closed

cypress run crashes after last test #3073

fr0 opened this issue Jan 7, 2019 · 5 comments

Comments

@fr0
Copy link

fr0 commented Jan 7, 2019

Current behavior:

Stack trace:

<--- Last few GCs --->

[47342:0x7fa64d826200]   134714 ms: Mark-sweep 2056.0 (2124.7) -> 2056.1 (2105.2) MB, 2729.7 / 0.0 ms  (+ 0.0 ms in 0 steps since start of marking, biggest step 0.0 ms, walltime since start of marking 2730 ms) last resort 
[47342:0x7fa64d826200]   137519 ms: Mark-sweep 2056.1 (2105.2) -> 2055.9 (2104.7) MB, 2803.9 / 0.0 ms  last resort 


<--- JS stacktrace --->

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

Security context: 0x35f884aad681 <JSObject>
    1: isListTerminator(aka isListTerminator) [/Users/crfrolik/Documents/atlas-dev-tools-proto/node_modules/typescript/lib/typescript.js:~17249] [pc=0x2f6ac95479fe](this=0x34a237802311 <undefined>,kind=20)
    2: parseBracketedList(aka parseBracketedList) [/Users/crfrolik/Documents/atlas-dev-tools-proto/node_modules/typescript/lib/typescript.js:~17700] [pc=0x2f6ac9509060](this=0x34a237802311 <un...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: node::Abort() [/Users/crfrolik/Library/Caches/Cypress/3.1.4/Cypress.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 2: node::FatalError(char const*, char const*) [/Users/crfrolik/Library/Caches/Cypress/3.1.4/Cypress.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 3: v8::internal::FatalProcessOutOfMemory(char const*) [/Users/crfrolik/Library/Caches/Cypress/3.1.4/Cypress.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 4: v8::internal::FatalProcessOutOfMemory(char const*) [/Users/crfrolik/Library/Caches/Cypress/3.1.4/Cypress.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 5: v8::internal::Factory::NewFixedArray(int, v8::internal::PretenureFlag) [/Users/crfrolik/Library/Caches/Cypress/3.1.4/Cypress.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 6: v8::internal::CodeFactory::FunctionPrototypeBind(v8::internal::Isolate*) [/Users/crfrolik/Library/Caches/Cypress/3.1.4/Cypress.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 7: v8::internal::CodeFactory::FunctionPrototypeBind(v8::internal::Isolate*) [/Users/crfrolik/Library/Caches/Cypress/3.1.4/Cypress.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 8: v8::internal::compiler::Pipeline::AllocateRegistersForTesting(v8::internal::RegisterConfiguration const*, v8::internal::compiler::InstructionSequence*, bool) [/Users/crfrolik/Library/Caches/Cypress/3.1.4/Cypress.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 9: v8::internal::Parser::PatternRewriter::VisitSuspend(v8::internal::Suspend*) [/Users/crfrolik/Library/Caches/Cypress/3.1.4/Cypress.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
10: v8::internal::Parser::PatternRewriter::VisitSuspend(v8::internal::Suspend*) [/Users/crfrolik/Library/Caches/Cypress/3.1.4/Cypress.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
11: v8::internal::Compiler::FinalizeCompilationJob(v8::internal::CompilationJob*) [/Users/crfrolik/Library/Caches/Cypress/3.1.4/Cypress.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
12: v8::internal::OptimizingCompileDispatcher::InstallOptimizedFunctions() [/Users/crfrolik/Library/Caches/Cypress/3.1.4/Cypress.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
13: v8::internal::StackGuard::HandleInterrupts() [/Users/crfrolik/Library/Caches/Cypress/3.1.4/Cypress.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
14: v8::internal::RegisterConfiguration::AreAliases(v8::internal::MachineRepresentation, int, v8::internal::MachineRepresentation, int) const [/Users/crfrolik/Library/Caches/Cypress/3.1.4/Cypress.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
15: 0x2f6ac91043fd
16: 0x2f6ac95479fe

I'm guessing that it has finished all tests - the crash actually occurs after Cypress prints out that it is running the last spec file.

I tried setting numTestsKeptInMemory to 0, and that did not help.

Desired behavior:

cypress run should not crash.

Steps to reproduce: (app code and test code)

Can't upload my repo, sorry.

Versions

Cypress package version: 3.1.4
Cypress binary version: 3.1.4

Mac OS X 10.13.6

@jennifer-shehane
Copy link
Member

We will need a reproducible example of this crash behavior. Can anyone provide a way to reproduce this - app code + test code?

@jennifer-shehane jennifer-shehane added the stage: needs information Not enough info to reproduce the issue label Jan 8, 2019
@gustawx
Copy link

gustawx commented Apr 17, 2019

I have the similar problem also when running all specs from cypress runner

(node:17544) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 close listeners added. Use emitter.setMaxListeners() to increase limit
(node:18964) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 preprocessor:close listeners added. Use emitter.setMaxListeners() to increase limit
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory

<--- Last few GCs --->

[18964:000001F6A2366990]   155526 ms: Mark-sweep 2049.4 (2138.4) -> 2049.3 (2138.4) MB, 1631.8 / 0.0 ms  allocation failure GC in old space requested
[18964:000001F6A2366990]   157004 ms: Mark-sweep 2049.3 (2138.4) -> 2049.3 (2107.4) MB, 1477.3 / 0.0 ms  last resort
[18964:000001F6A2366990]   158662 ms: Mark-sweep 2049.3 (2107.4) -> 2049.3 (2107.4) MB, 1657.7 / 0.0 ms  last resort


<--- JS stacktrace --->

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

Security context: 0000033FBF9AD681 <JSObject>
    2: stringSlice(aka stringSlice) [buffer.js:556] [bytecode=000003A8F0B7CE71 offset=96](this=000000FB6F002311 <undefined>,buf=00000115D60FFDF1 <Uint8Array map = 00000173BB1D0751>,encoding=0000033FBF9BD301 <String[4]: utf8>,start=0,end=311104)
    4: toString [buffer.js:629] [bytecode=000003A8F0B7CAA9 offset=151](this=00000115D60FFDF1 <Uint8Array map = 00000173BB1D0751>,encoding=0000033FBF9BD...

There is another problem related to this. When i set up node flag:
export NODE_OPTIONS=--max-old-space-size=4096

cypress fails to run without any error! The process just closes. I'm not sure if this is a seperate issue so I don't open a new one...

the tests that I'm running are mostly API tests ( normal rest calls ) and 3 small UI tests. I think i can't post a code here but this is really nothing special, just some visit(), request() etc

EDIT:
the error above occurs before tests even start running

@kjellski
Copy link

We're facing the same issue, but are unable to share the code unfortunately.

@jennifer-shehane
Copy link
Member

@gustawx Setting the NODE_OPTIONS environment variable if you have this set - as this causes Cypress to crash. This is due to an Electron bug prior to version 2.0.3, where having NODE_OPTIONS set causes either a failure or arguments to be ignored. electron/electron#12695 (comment)

To unset NODE_OPTIONS environment variable

MacOS / Linux

unset NODE_OPTIONS # this is not the same as export NODE_OPTIONS=

Windows

set NODE_OPTIONS=

We have open issues for this being fixed that you can follow here:

@jennifer-shehane
Copy link
Member

Unfortunately we have to close this issue as there is not enough information to reproduce the problem.

Please comment in this issue with a reproducible example and we will reopen the issue. 🙏

@jennifer-shehane jennifer-shehane removed the stage: needs information Not enough info to reproduce the issue label Apr 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants