How can I determine what is causing karma to take so long to begin running tests?

20 views
Skip to first unread message

aul...@gmail.com

unread,
Aug 25, 2017, 11:32:07 AM8/25/17
to karma-users
I posted this on SO yesterday.  Basically, the more tests I have the longer it takes for karma to start running them.  Even with zero tests it still takes about 4 minutes to even get to the point where tests would be executed.  I have narrowed it down to something between loading middleware and starting the karma server.  Unfortunately, I haven't figured out how to log more details during these steps.  Does anyone have any suggestions for how I can determine what is taking so long?

Aaron Ullom

unread,
Aug 25, 2017, 2:42:40 PM8/25/17
to karma-users
So I started adding more logging to karma, and I think I have ruled out karma as being the problem.  It looks like awesome-typescript-loader spends several minutes calling ensureInstance (hundreds of calls).  The number of calls increases with the number of tests.  When I have zero tests it makes 414 calls.  15 tests = 453 calls.  76 tests = 468 calls.

This is version 3.1.3.  Has anyone seen this or know what is going on?

Aaron Ullom

unread,
Aug 28, 2017, 4:22:21 PM8/28/17
to karma-users
It seems to be an issue with resolving types down into the node_modules directory.  For some reason it is resolving the same type multiple times (for different files, of course).  But why did it already scan into node_modules in an init step if it was going to keep scanning?

Aaron Ullom

unread,
Aug 30, 2017, 12:07:16 PM8/30/17
to karma-users
I think I got down to the root cause.  The virtual desktop where I am running takes at least 45 minute before it even begins to run the karma tests.  That's a lot compared to the build server (15 minutes) and my personal laptop (5 minutes).  The issue seems to be storage in the virtual environments - it's just too slow.
Reply all
Reply to author
Forward
0 new messages