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

CP-1358 Add option to not cache jspm_packages #126

Closed
wants to merge 2 commits into from
Closed

CP-1358 Add option to not cache jspm_packages #126

wants to merge 2 commits into from

Conversation

AurelienRibon
Copy link
Contributor

This solves OSX bug with EMFILE: too many open files. The default is not changed, the change is proposed as an option to include in config file.

image

@maxwellpeterson-wf
Copy link
Contributor

@AurelienRibon have you seen #115 that was released in karma-jspm 2.0.3? Does that satisfy your needs here?

@AurelienRibon
Copy link
Contributor Author

I already saw this fix and tried my use-case on the HEAD of master before send the PR. Fix #115 is to disable cache for user files, my PR is to disable it for files in jspm_packages. My team work on a huge project and we are trying to use karma-jspm on OSX, with no luck because of that EMFILE error. We have only one file to load for now, so #115 is not useful for us, but our jspm_packages directory is monstrous. This PR does fix our issue though.

@maxwellpeterson-wf
Copy link
Contributor

Let's just default this option to true, I imagine this is a pretty common issue for people as jspm_packages tends to get huge.

@AurelienRibon
Copy link
Contributor Author

Awesome! Do you want to handle that or should I push another commit? What should be the name of the option? cachePackages ?

@maxwellpeterson-wf
Copy link
Contributor

Yeah, I like that. So I think it would be

var jspmPattern = createServedPattern(packagesPath + '**/*', jspm.cachePackages !== true);

Feel free to push another commit or amend your original commit and force push, whichever you prefer

@maxwellpeterson-wf
Copy link
Contributor

While you're at it if you'd like to add it to the README for others, that would be nice

@AurelienRibon
Copy link
Contributor Author

Done!

@maxwellpeterson-wf
Copy link
Contributor

@trentgrover-wf
Copy link
Collaborator

+1

@jayudey-wf jayudey-wf changed the title Add option to not cache jspm_packages CP-1358 Add option to not cache jspm_packages Feb 10, 2016
@evanweible-wf
Copy link
Contributor

+1

1 similar comment
@maaravi
Copy link

maaravi commented Feb 17, 2016

+1

@jayudey-wf
Copy link
Contributor

when I install your branch into a project that is consuming karma-jspm i'm seeing the following error messages when running unit tests through sauce labs

[13:54:40] Starting Karma server...
INFO [karma]: Karma v0.12.31 server started at http://localhost:9876/
INFO [launcher]: Starting browser chrome on SauceLabs
INFO [launcher]: Starting browser firefox on SauceLabs
INFO [launcher]: Starting browser safari 7 (OS X 10.9) on SauceLabs
INFO [launcher]: Starting browser internet explorer 8 (Windows 7) on SauceLabs
INFO [launcher]: Starting browser internet explorer 10 (Windows 7) on SauceLabs
INFO [launcher]: Starting browser internet explorer 11 (Windows 7) on SauceLabs
INFO [launcher.sauce]: chrome session at https://saucelabs.com/tests/ed2b2c7a10dc43a592f45d88e45bd4b0
INFO [launcher.sauce]: internet explorer 10 (Windows 7) session at https://saucelabs.com/tests/dc463e4e0d52456d8d3779b50c7a5453
INFO [launcher.sauce]: firefox session at https://saucelabs.com/tests/11457911da51425a9179e1953f08baa1
INFO [launcher.sauce]: internet explorer 8 (Windows 7) session at https://saucelabs.com/tests/66ce74bc33e244e199df692131109df0
INFO [launcher.sauce]: internet explorer 11 (Windows 7) session at https://saucelabs.com/tests/ada95d6dde8146f59721d3610415857d
WARN [web-server]: 404: /favicon.ico
INFO [Chrome 48.0.2564 (Linux)]: Connected on socket MRnoWy9acYs99PDx2Qxy with id 50156322
INFO [IE 10.0.0 (Windows 7)]: Connected on socket Uu_zvZAnfaG6w33F2Qxz with id 93601621
INFO [Firefox 44.0.0 (Linux)]: Connected on socket VfnknaJnNUZw_ya82Qx0 with id 41333545
INFO [IE 11.0.0 (Windows 7)]: Connected on socket VZKvc-4CfckyuAgZ2Qx1 with id 41961246
INFO [IE 8.0.0 (Windows 7)]: Connected on socket bB8Y4oxuhneIYJdP2Qx2 with id 91059506
IE 8.0.0 (Windows 7) ERROR: 'Potentially unhandled rejection [3] Object doesn't support this property or method'
IE 8.0.0 (Windows 7) ERROR: 'Potentially unhandled rejection [3] Object doesn't support this property or method'
IE 10.0.0 (Windows 7) ERROR: 'Potentially unhandled rejection [3] TypeError: Object doesn't support this action
    Evaluating http://localhost:9876/base/jspm_packages/npm/sockjs-client@1.0.0-beta.10/lib/main.js
    Evaluating http://localhost:9876/base/jspm_packages/npm/sockjs-client@1.0.0-beta.10/lib/entry.js
    Evaluating http://localhost:9876/base/jspm_packages/npm/sockjs-client@1.0.0-beta.10.js
    Evaluating http://localhost:9876/base/jspm_packages/github/Workiva/wTransport@2.2.1/WSocket.js
    Evaluating http://localhost:9876/base/jspm_packages/github/Workiva/wTransport@2.2.1/wTransport.js
    Evaluating http://localhost:9876/base/jspm_packages/github/Workiva/wTransport@2.2.1.js
    Evaluating http://localhost:9876/base/jspm_packages/github/Workiva/wService@2.2.2/providers/HTTPProvider.js
    Evaluating http://localhost:9876/base/build/test/Session.spec.js
    Error loading http://localhost:9876/base/build/test/Session.spec.js
   at getESModule (http://localhost:9876/base/jspm_packages/system.src.js?38538ebca96bc7b222f7e7ba15943f173a485f6e:1274:9)
   at linkDynamicModule (http://localhost:9876/base/jspm_packages/system.src.js?38538ebca96bc7b222f7e7ba15943f173a485f6e:3146:7)
   at getModule (http://localhost:9876/base/jspm_packages/system.src.js?38538ebca96bc7b222f7e7ba15943f173a485f6e:3094:9)
   at Anonymous function (http://localhost:9876/base/jspm_packages/system.src.js?38538ebca96bc7b222f7e7ba15943f173a485f6e:3130:9)
   at require (http://localhost:9876/base/jspm_packages/system.src.js?38538ebca96bc7b222f7e7ba15943f173a485f6e:3740:13)
   at Anonymous function (eval code:17:7)
   at Anonymous function (eval code:2:2)
   at eval code (eval code:1:2)
   at __exec (http://localhost:9876/base/jspm_packages/system.src.js?38538ebca96bc7b222f7e7ba15943f173a485f6e:1395:8)
   at execute (http://localhost:9876/base/jspm_packages/system.src.js?38538ebca96bc7b222f7e7ba15943f173a485f6e:3767:11)'
IE 10.0.0 (Windows 7) ERROR: 'Potentially unhandled rejection [3] TypeError: Object doesn't support this action
    Evaluating http://localhost:9876/base/jspm_packages/npm/sockjs-client@1.0.0-beta.10/lib/main.js
    Evaluating http://localhost:9876/base/jspm_packages/npm/sockjs-client@1.0.0-beta.10/lib/entry.js
    Evaluating http://localhost:9876/base/jspm_packages/npm/sockjs-client@1.0.0-beta.10.js
    Evaluating http://localhost:9876/base/jspm_packages/github/Workiva/wTransport@2.2.1/WSocket.js
    Evaluating http://localhost:9876/base/jspm_packages/github/Workiva/wTransport@2.2.1/wTransport.js
    Evaluating http://localhost:9876/base/jspm_packages/github/Workiva/wTransport@2.2.1.js
    Evaluating http://localhost:9876/base/jspm_packages/github/Workiva/wService@2.2.2/providers/HTTPProvider.js
    Evaluating http://localhost:9876/base/build/test/Session.spec.js
    Error loading http://localhost:9876/base/build/test/Session.spec.js
   at getESModule (http://localhost:9876/base/jspm_packages/system.src.js?38538ebca96bc7b222f7e7ba15943f173a485f6e:1274:9)
   at linkDynamicModule (http://localhost:9876/base/jspm_packages/system.src.js?38538ebca96bc7b222f7e7ba15943f173a485f6e:3146:7)
   at getModule (http://localhost:9876/base/jspm_packages/system.src.js?38538ebca96bc7b222f7e7ba15943f173a485f6e:3094:9)
   at Anonymous function (http://localhost:9876/base/jspm_packages/system.src.js?38538ebca96bc7b222f7e7ba15943f173a485f6e:3130:9)
   at require (http://localhost:9876/base/jspm_packages/system.src.js?38538ebca96bc7b222f7e7ba15943f173a485f6e:3740:13)
   at Anonymous function (eval code:17:7)
   at Anonymous function (eval code:2:2)
   at eval code (eval code:1:2)
   at __exec (http://localhost:9876/base/jspm_packages/system.src.js?38538ebca96bc7b222f7e7ba15943f173a485f6e:1395:8)
   at execute (http://localhost:9876/base/jspm_packages/system.src.js?38538ebca96bc7b222f7e7ba15943f173a485f6e:3767:11)'
INFO [launcher.sauce]: safari 7 (OS X 10.9) session at https://saucelabs.com/tests/c6b591fd001744bf9e1b3a83b988fc84
IE 11.0.0 (Windows 7) ERROR: 'Potentially unhandled rejection [3] TypeError: Object doesn't support this action
    Evaluating http://localhost:9876/base/jspm_packages/npm/sockjs-client@1.0.0-beta.10/lib/main.js
    Evaluating http://localhost:9876/base/jspm_packages/npm/sockjs-client@1.0.0-beta.10/lib/entry.js
    Evaluating http://localhost:9876/base/jspm_packages/npm/sockjs-client@1.0.0-beta.10.js
    Evaluating http://localhost:9876/base/jspm_packages/github/Workiva/wTransport@2.2.1/WSocket.js
    Evaluating http://localhost:9876/base/jspm_packages/github/Workiva/wTransport@2.2.1/wTransport.js
    Evaluating http://localhost:9876/base/jspm_packages/github/Workiva/wTransport@2.2.1.js
    Evaluating http://localhost:9876/base/jspm_packages/github/Workiva/wService@2.2.2/providers/HTTPProvider.js
    Evaluating http://localhost:9876/base/build/test/Session.spec.js
    Error loading http://localhost:9876/base/build/test/Session.spec.js
   at getESModule (http://localhost:9876/base/jspm_packages/system.src.js?38538ebca96bc7b222f7e7ba15943f173a485f6e:1274:9)
   at linkDynamicModule (http://localhost:9876/base/jspm_packages/system.src.js?38538ebca96bc7b222f7e7ba15943f173a485f6e:3146:7)
   at getModule (http://localhost:9876/base/jspm_packages/system.src.js?38538ebca96bc7b222f7e7ba15943f173a485f6e:3094:9)
   at Anonymous function (http://localhost:9876/base/jspm_packages/system.src.js?38538ebca96bc7b222f7e7ba15943f173a485f6e:3130:9)
   at require (http://localhost:9876/base/jspm_packages/system.src.js?38538ebca96bc7b222f7e7ba15943f173a485f6e:3740:13)
   at Anonymous function (eval code:17:7)
   at Anonymous function (eval code:2:2)
   at eval code (eval code:1:2)
   at __exec (http://localhost:9876/base/jspm_packages/system.src.js?38538ebca96bc7b222f7e7ba15943f173a485f6e:1395:8)
   at entry.execute (http://localhost:9876/base/jspm_packages/system.src.js?38538ebca96bc7b222f7e7ba15943f173a485f6e:3767:11)'
IE 11.0.0 (Windows 7) ERROR: 'Potentially unhandled rejection [3] TypeError: Object doesn't support this action
    Evaluating http://localhost:9876/base/jspm_packages/npm/sockjs-client@1.0.0-beta.10/lib/main.js
    Evaluating http://localhost:9876/base/jspm_packages/npm/sockjs-client@1.0.0-beta.10/lib/entry.js
    Evaluating http://localhost:9876/base/jspm_packages/npm/sockjs-client@1.0.0-beta.10.js
    Evaluating http://localhost:9876/base/jspm_packages/github/Workiva/wTransport@2.2.1/WSocket.js
    Evaluating http://localhost:9876/base/jspm_packages/github/Workiva/wTransport@2.2.1/wTransport.js
    Evaluating http://localhost:9876/base/jspm_packages/github/Workiva/wTransport@2.2.1.js
    Evaluating http://localhost:9876/base/jspm_packages/github/Workiva/wService@2.2.2/providers/HTTPProvider.js
    Evaluating http://localhost:9876/base/build/test/Session.spec.js
    Error loading http://localhost:9876/base/build/test/Session.spec.js
   at getESModule (http://localhost:9876/base/jspm_packages/system.src.js?38538ebca96bc7b222f7e7ba15943f173a485f6e:1274:9)
   at linkDynamicModule (http://localhost:9876/base/jspm_packages/system.src.js?38538ebca96bc7b222f7e7ba15943f173a485f6e:3146:7)
   at getModule (http://localhost:9876/base/jspm_packages/system.src.js?38538ebca96bc7b222f7e7ba15943f173a485f6e:3094:9)
   at Anonymous function (http://localhost:9876/base/jspm_packages/system.src.js?38538ebca96bc7b222f7e7ba15943f173a485f6e:3130:9)
   at require (http://localhost:9876/base/jspm_packages/system.src.js?38538ebca96bc7b222f7e7ba15943f173a485f6e:3740:13)
   at Anonymous function (eval code:17:7)
   at Anonymous function (eval code:2:2)
   at eval code (eval code:1:2)
   at __exec (http://localhost:9876/base/jspm_packages/system.src.js?38538ebca96bc7b222f7e7ba15943f173a485f6e:1395:8)
   at entry.execute (http://localhost:9876/base/jspm_packages/system.src.js?38538ebca96bc7b222f7e7ba15943f173a485f6e:3767:11)'
................................................................................
.
Firefox 44.0.0 (Linux): Executed 81 of 81 SUCCESS (5.238 secs / 5.144 secs)
................................................................................
.
Chrome 48.0.2564 (Linux): Executed 81 of 81 SUCCESS (5.303 secs / 5.187 secs)
WARN [IE 8.0.0 (Windows 7)]: Disconnected (1 times), because no message in 10000 ms.
IE 8.0.0 (Windows 7): Executed 0 of 0 DISCONNECTED (10.462 secs / 0 secs)
WARN [IE 10.0.0 (Windows 7)]: Disconnected (1 times), because no message in 10000 ms.
IE 10.0.0 (Windows 7): Executed 0 of 0 DISCONNECTED (12.377 secs / 0 secs)
WARN [IE 11.0.0 (Windows 7)]: Disconnected (1 times), because no message in 10000 ms.
IE 11.0.0 (Windows 7): Executed 0 of 0 DISCONNECTED (13.368 secs / 0 secs)
INFO [Safari 7.1.7 (Mac OS X 10.9.5)]: Connected on socket EdcFEJi9fKSqZpD22Qx3 with id 4304025
................................................................................
.
Safari 7.1.7 (Mac OS X 10.9.5): Executed 81 of 81 SUCCESS (5.291 secs / 5.109 secs)
INFO [launcher.sauce]: Shutting down Sauce Connect
[13:55:52] 'karma' errored after 1.2 min
[13:55:53] Error in plugin 'gulp-karma'

@Jenselme
Copy link

👍

@evuolas
Copy link

evuolas commented Apr 13, 2016

Having the same issue and this pull request seems to fix it, thank you!

Any idea when this fix will be merged to the master?

@RomanHotsiy
Copy link

RomanHotsiy commented May 5, 2016

@jayudey-wf @maxwellpeterson-wf
This is an annoying issue. I have to use the fork in order to have things work for me.
I see that @jayudey-wf has errors on IE on SauceLabs. But not all folks have SauceLabs set up. Just make the option false by default and merge this, please.

@rmconsole-wf
Copy link
Contributor

@AurelienRibon This pull request has merge conflicts, please resolve.

@evanweible-wf
Copy link
Contributor

Merged here: #151

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants