Visual studio 2012 slow unit testing

2019-01-17 15:14发布

Running unit tests on VS2012 is lately very slow, when I run them it takes about 12 seconds before they start actually testing.

When I debug it is the same story before I hit the first breakpoint.

I hooked up process monitor and then I found this:

CreateFile \\WORKSTATION*\MAILSLOT\NET\NETLOGON SUCCESS

WriteFile \\WORKSTATION*\MAILSLOT\NET\NETLOGON BAD NETWORK PATH

After that it stays 9 seconds quiet.

CloseFile \\WORKSTATION*\MAILSLOT\NET\NETLOGON SUCCESS

What on earth is going on here? I cannot find any relation between MAILSLOT and Visual Studio at all, but it is going on for about 2 weeks now.

3条回答
smile是对你的礼貌
2楼-- · 2019-01-17 15:43

This may not be related, but I noticed in some testing I was doing today that my Unit tests seemed to be running slower and slower. By chance I exited/restared Visual Studio and my tests are much faster now. There may be some sort of memory leak or other resource problem in the Unit Test mechanism. I am running update 1.

查看更多
对你真心纯属浪费
3楼-- · 2019-01-17 15:49

I had the same issue, using VS2012 Update 1. Based on the suggestion in http://social.technet.microsoft.com/Forums/en-US/winserverDS/thread/20eb50e9-3e68-4d29-bcdd-a4fc166b9c00 I disabled NetBios over TCP on my NIC. The tests now start up immediately, and procmon shows the time waiting on \MACHINE*\MAILSLOT\NET\NETLOGON dropped from 5 seconds to about 40 microseconds.

查看更多
Root(大扎)
4楼-- · 2019-01-17 16:02

Visual Studio update 1 is now available and apparently addresses some speed issues with unit testing, whether it's related to Mailslot or not I don't know but presumably that's possible if it's in use as a communication mechanism by mstest somehow, from the MSDN forums:

In the upcoming Visual Studio quarterly release (ref http://blogs.msdn.com/b/visualstudioalm/archive/2012/10/08/visual-studio-2012-update-1-ctp.aspx), we have made some performance improvements. In short, we changed the underlying storage mechanism to improve the discovery/run time.

Download links and info here:

http://blogs.msdn.com/b/visualstudioalm/archive/2012/11/26/visual-studio-and-team-foundation-server-2012-update-1-now-available.aspx

查看更多
登录 后发表回答