Skip to content
This repository has been archived by the owner on Jun 28, 2021. It is now read-only.

npm test fails with out of memory #230

Closed
Download opened this issue Feb 21, 2016 · 5 comments
Closed

npm test fails with out of memory #230

Download opened this issue Feb 21, 2016 · 5 comments

Comments

@Download
Copy link
Contributor

I'm not saying this is an issue with this repo, just that this happened to me just now when trying to run npm test after forking this repo, cloning it to my (Windows 10) machine and npm installing it:

c:\ws\react-mdl>npm test

> [email protected] test c:\ws\react-mdl
> karma start --single-run


START:

<--- Last few GCs --->

  204700 ms: Scavenge 1396.7 (1458.1) -> 1396.7 (1458.1) MB, 2.3 / 0 ms [allocation failure].
  204700 ms: Scavenge 1396.7 (1458.1) -> 1396.7 (1458.1) MB, 2.3 / 0 ms [allocation failure].
  204700 ms: Scavenge 1396.7 (1458.1) -> 1396.7 (1458.1) MB, 2.8 / 0 ms [allocation failure].
  206369 ms: Mark-sweep 1396.7 (1458.1) -> 1396.7 (1458.1) MB, 1655.1 / 0 ms [last resort gc].
  207940 ms: Mark-sweep 1396.7 (1458.1) -> 1396.7 (1458.1) MB, 1571.9 / 0 ms [last resort gc].


<--- JS stacktrace --->

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

Security context: 000002ACD95E3AD1 <JS Object>
    1: /* anonymous */(aka /* anonymous */) [c:\ws\react-mdl\node_modules\webpack-core\lib\OriginalSource.js:~68] [pc=000001BAC6DF749F] (this=000002ACD9504189 <undefined>,item=000001515179DC79 <String[9]: "start":{>)
    2: arguments adaptor frame: 3->1
    3: InnerArrayMap(aka InnerArrayMap) [native array.js:~1019] [pc=000001BAC6E33D94] (this=000002ACD9504189 <undefined>,bl=000001C8F2C44319 ...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory
npm ERR! Test failed.  See above for more details.

c:\ws\react-mdl>

Feel free to close, just posting this in case you like to know.

Thanks for your work on this lib btw.

@tleunen
Copy link
Owner

tleunen commented Feb 22, 2016

Interesting. I'll leave it open for now. Maybe someone knows why it's happening.

On the long term, the tests will change and I'll probably drop karma for jsdom (with Enzyme)

@Download
Copy link
Contributor Author

I tried a few more times but it is consistent. It's probably got something to do with the combination Karma/Windows I suspect.

Why the need for a framework like that though? Your components are mostly pretty simple so why not just test the output or ReactDOMServer.renderToString?

it is consistent.

EDIT: Maybe I have to expain that a bit more... It consistently crashes with an out of memory, but the output is different each time, so it's not crashing in the same code.

@tleunen
Copy link
Owner

tleunen commented Feb 22, 2016

A component is not just an output, sometimes it's more than than with logic. So you cannot really use renderToString. That's why we currently use karma.
For the v2, I'd like to not depend on the MDL js part, in order to build real react component. So we'll have more "complex" component and we'll need to test them.

About the memory issue, I have no idea :s I never got any crash when testing locally or on Travis

@Download
Copy link
Contributor Author

For the v2, I'd like to not depend on the MDL js part, in order to build real react component.

Yes! It would be so much better! :)

@tleunen
Copy link
Owner

tleunen commented Feb 26, 2016

@Download I found a similar issue here karma-runner/karma#1868
We can try to move to this configuration to see if it resolves your issue https://github.com/webpack/karma-webpack#alternative-usage

@tleunen tleunen closed this as completed in a9c2fc7 Mar 2, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants