material icon indicating copy to clipboard operation
material copied to clipboard

My app unit tests 20x times slower when upgrading to 0.9.0-rc1

Open demisx opened this issue 11 years ago • 24 comments

I am running my app unit test in karma 0.12.31 and phantomJS 1.9.16. I am seeing a weird issue when upgrading to the latest ng material 0.9.0-rc1: my app unit tests drastically slow down and some tests even start timing out after 2 seconds due to the done callback not being called. What used to take 3 seconds to execute all app unit tests under 0.8.3, now it takes 60 seconds to execute less than 50% of the tests with 0.9.0-rc1. Rolling back angular material to 0.8.3 brings everything back to normal. Please let me know if you guys have any idea what may be going on.

demisx avatar Apr 21 '15 01:04 demisx

@demisx - Have you run npm cache clean; npm update ? Afterwards, what versions of node, npm, karma, and gulp are you using? Also please check your /node_modules/angular and determine which version of Angular has been installed.

BTW, Our unit test now run in three (3) passes to test the following usages: (a) unminified, (b) minified, and (c) minified with jQuery. Here is my console log:

~/projects/material [master]: gulp karma
[22:04:11] Using gulpfile ~/projects/material/gulpfile.js
[22:04:11] Starting 'karma'...
[22:04:11] Running unit tests on unminified source.
[22:04:11] building js files...
INFO [karma]: Karma v0.12.32 server started at http://localhost:9876/
INFO [launcher]: Starting browser Chrome
INFO [Chrome 42.0.2311 (Mac OS X 10.9.5)]: Connected on socket lwB2LOoOSgfo-OnCAAAA with id 2788103
Chrome 42.0.2311 (Mac OS X 10.9.5): Executed 391 of 391 SUCCESS (6.069 secs / 6.004 secs)
[22:04:20] Running unit tests on minified source.
INFO [karma]: Karma v0.12.32 server started at http://localhost:9876/
INFO [launcher]: Starting browser Chrome
INFO [Chrome 42.0.2311 (Mac OS X 10.9.5)]: Connected on socket bRLoJFmkPRi1IhVMAAAB with id 68412939
Chrome 42.0.2311 (Mac OS X 10.9.5): Executed 391 of 391 SUCCESS (8.579 secs / 8.465 secs)
[22:04:30] Running unit tests on minified source w/ jquery.
INFO [karma]: Karma v0.12.32 server started at http://localhost:9876/
INFO [launcher]: Starting browser Chrome
INFO [Chrome 42.0.2311 (Mac OS X 10.9.5)]: Connected on socket ny0Hk591W1epVqaAAAAC with id 7520570
Chrome 42.0.2311 (Mac OS X 10.9.5): Executed 391 of 391 SUCCESS (8.773 secs / 8.661 secs)
[22:04:39] Finished 'karma' after 29 s

ThomasBurleson avatar Apr 21 '15 02:04 ThomasBurleson

@ThomasBurleson Please see below. I just wanted to clarify, that I am seeing this behavior with my app own unit tests, not the ng material project unit tests.

Have you run npm cache clean; npm update?

Yes. I've also tried checking out the app branch clean on another laptop. Same issue

Afterwards, what versions of node, npm, karma, and gulp are you using? Also please check your /node_modules/angular and determine which version of Angular has been installed.

node = 0.12.2 karma = 0.12.31 gulp = v4 angular = 1.4.0-rc0

demisx avatar Apr 21 '15 03:04 demisx

I'm experiencing the same issue

cognitronic avatar Apr 21 '15 11:04 cognitronic

@demisx -

  • Where did you find Angular 1.4.0-rc1? That version does not exist.
  • You are using Gulp v4? The latest version online seems to be 3.8.11...

ThomasBurleson avatar Apr 21 '15 12:04 ThomasBurleson

@ThomasBurleson I have my sources. :) Sorry, I meant 1.4.0-rc0, of course. I'll update the comment.

demisx avatar Apr 21 '15 15:04 demisx

@ThomasBurleson Regarding gulp, v4 has been in alpha for a while now and runs fine. The gulp task for kicking off unit tests is pretty standard, though:

gulp.task('unit', function () {
  karma.start({
    configFile: __dirname + '/specs/unit/karma.config.js',
    singleRun: true
  });
});

demisx avatar Apr 21 '15 18:04 demisx

Same problem here. To make it clear: my own unit test are not running any more (timeout on phantomJS) or are incredibly slow (chrome) with the 0.9.x release.

nsdcss avatar Apr 22 '15 05:04 nsdcss

@all - This will be investigated today.

ThomasBurleson avatar Apr 22 '15 12:04 ThomasBurleson

If you guys can't replicate the issue, I can show it on my desktop via online meeting or something. I think creating a plunker maybe somewhat challenging here.

demisx avatar Apr 22 '15 14:04 demisx

Same issue here on our app after upgrading to 0.9.0-rc3

arthurazevedofranca avatar Apr 29 '15 22:04 arthurazevedofranca

@demisx - I think a Hangout would be the best venue to pair-investigate this issue; as we are not seeing this issue with our core team development. Can you email me.

ThomasBurleson avatar Apr 29 '15 23:04 ThomasBurleson

@ThomasBurleson Hi Thomas. I've sent you the email a couple of days ago. Just wanted to make sure you got it. It was sent to gmail shown on your GH profile page.

demisx avatar May 01 '15 14:05 demisx

Hey Dmitri, Yes, I did receive your email(s). The team and I have been very busy trying to get the final release of 0.9.0 resolved and published. Can you and I have a hangout next Tuesday afternoon (CST)? What GST/Timezone are you in?

I look forward to our hangout and [hopefully] resolve this testing issue. Thanks again.

Thomas

On Fri, May 1, 2015 at 9:39 AM Dmitri Moore [email protected] wrote:

@ThomasBurleson https://github.com/ThomasBurleson Hi Thomas. I've sent you the email a couple of days ago. Just wanted to make sure you got it. It was sent to gmail shown on your GH profile page.

— Reply to this email directly or view it on GitHub https://github.com/angular/material/issues/2439#issuecomment-98146185.

ThomasBurleson avatar May 01 '15 16:05 ThomasBurleson

Same issue here. Already tried with PhatomJS 2, and had no luck. What could angular-material have changed in such a global way that could have affected performance of any tests running under PhantomJS? This performance hit happens with all our tests. The simple fact that angular-material.js is loaded causes the problem. Notice that the problem started with 0.9rc1.

demetriusnunes avatar May 04 '15 13:05 demetriusnunes

Why don't you guys just load the tests in chrome and inspect what is causing these slowdowns?

gngeorgiev avatar May 05 '15 14:05 gngeorgiev

Happens here as well

nmichaud2 avatar May 05 '15 19:05 nmichaud2

I'm seeing the same problem after upgrading angular-material to v0.9.0

node v0.12.2 angular v1.3.15 angular-material v0.9.0 gulp v3.8.11 karma v0.12.32 jasmine-core v2.3.0 karma-jasmine v0.3.5 karma-phantomjs-launcher v0.1.4

PhantomJS 1.9.8 (Mac OS X): Executed 84 of 215 SUCCESS (0 secs / 30.36 secs)
PhantomJS 1.9.8 (Mac OS X): Executed 84 of 215 DISCONNECTED (39.639 secs / 30.36 secs)
[08:33:29] 'test' errored after 42 s
[08:33:29] Error: karma: tests failed with code 1
  at formatError (/Users/jaredcacurak/.npm-packages/lib/node_modules/gulp/bin/gulp.js:169:10)
  at Gulp.<anonymous> (/Users/jaredcacurak/.npm-packages/lib/node_modules/gulp/bin/gulp.js:195:15)
  at Gulp.emit (events.js:107:17)
  at Gulp.Orchestrator._emitTaskDone (/Users/jaredcacurak/stash/frontend/node_modules/gulp/node_modules/orchestrator/index.js:264:8)
  at /Users/jaredcacurak/stash/frontend/node_modules/gulp/node_modules/orchestrator/index.js:275:23
  at finish (/Users/jaredcacurak/stash/frontend/node_modules/gulp/node_modules/orchestrator/lib/runTask.js:21:8)
  at cb (/Users/jaredcacurak/stash/frontend/node_modules/gulp/node_modules/orchestrator/lib/runTask.js:29:3)
  at karmaComplete (/Users/jaredcacurak/stash/frontend/gulpfile.js:185:13)
  at removeAllListeners (/Users/jaredcacurak/stash/frontend/node_modules/karma/lib/server.js:220:7)
  at Server.<anonymous> (/Users/jaredcacurak/stash/frontend/node_modules/karma/lib/server.js:231:9)
  at Server.g (events.js:199:16)
  at Server.emit (events.js:129:20)
  at net.js:1409:10
  at process._tickCallback (node.js:355:11)

jaredcacurak avatar May 07 '15 12:05 jaredcacurak

Me too, the time taken to run my tests on phantomjs has increased by about 20 times. phantomjs memory usage increases progressively throughout the test run, as does the time taken for each test to complete.

Running my tests against Chrome is taking approximately twice as long as it was with angular-material 0.8.3.

Angular 1.3.15 PhatomJS: 1.9.16 Karma: 0.12.31 Node: 0.10.35

toboid avatar May 07 '15 12:05 toboid

And still no metrics guys? Use the Timeline tab or the profiler in developer tools to see what is taking so long. Just saying that it is slow does not help the ng-material team much.

gngeorgiev avatar May 07 '15 12:05 gngeorgiev

@everyone - We are aware of this issue; which originates [in part] from Theming changes and mocks. We plan to have a fix for this within the next 1-2 days.

ThomasBurleson avatar May 07 '15 13:05 ThomasBurleson