<p>We are using VS 2008 Team System with the automated test suite, and upon running tests the test host "randomly" locks up. I actually have to kill the VSTestHost process and re-run the tests to get something to happen, otherwise all tests sit in a "pending" state.</p>

<p>Has anyone experience similar behavior and know of a fix? We have 3 developers here experiencing the same behavior.</p>

[{'answer_id': 51063, 'author': 'Cory Foy', 'author_id': 4083, 'author_profile': 'https://Stackoverflow.com/users/4083', 'pm_score': 2, 'selected': False, 'text': '<p>When you say lock up, do you mean VS is actually hung, or do the tests not run?</p>\n\n<p>The easiest way to track down what is going on would be to look at a dump of the hung process. If you are on Vista, just right-click on the process and choose to create a memory dump. If you are on Windows XP, and don\'t have the <a href="http://www.microsoft.com/whdc/DevTools/Debugging/default.mspx" rel="nofollow noreferrer">Debugging Tools for Windows</a> installed, you can get a memory dump using ntsd.exe. You\'ll need the process ID, which you can get from Task Manager by adding the PID column to the Processes tab display.</p>\n\n<p>Once you have that, run the following commands:</p>\n\n<pre><code>ntsd -p &lt;PID&gt;\n.dump C:\\mydump.dmp\n</code></pre>\n\n<p>You can then either inspect that dump using <a href="http://blogs.msdn.com/johan/archive/2007/11/13/getting-started-with-windbg-part-i.aspx" rel="nofollow noreferrer">WinDBG and SOS</a> or if you can post the dump somewhere I\'d be happy to take a look at it.</p>\n\n<p>In any case, you\'ll want to likely take two dumps about a minute apart. That way if you do things like !runaway you can see which threads are working which will help you track down why it is hanging.</p>\n\n<p>One other question - are you on VS2008 SP1?</p>\n'}, {'answer_id': 51096, 'author': 'tbreffni', 'author_id': 637, 'author_profile': 'https://Stackoverflow.com/users/637', 'pm_score': 2, 'selected': False, 'text': '<p>I would try running the tests from the command line using <a href="http://msdn.microsoft.com/en-us/library/ms182486(VS.80).aspx" rel="nofollow noreferrer">MSTest.exe</a>.  This might help isolate the problem to Visual Studio, and at least give you some method of running the tests successfully.</p>\n'}, {'answer_id': 888372, 'author': 'Tim Long', 'author_id': 98516, 'author_profile': 'https://Stackoverflow.com/users/98516', 'pm_score': 2, 'selected': False, 'text': '<p>This may be related to an obscure bug that causes unit tests to hang unless the computer name is UPPERCASE. Crazy, I know - but I had this problem and the fix worked for me.</p>\n\n<p><a href="https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=403799" rel="nofollow noreferrer">Bug report</a> on MS Connect<br>\n<a href="https://connect.microsoft.com/VisualStudio/feedback/Workaround.aspx?FeedbackID=403799" rel="nofollow noreferrer">Workaround</a> on MS Connect<br>\n<a href="http://teamfoundation.blogspot.com/2008/12/case-of-never-ending-unit-tests.html" rel="nofollow noreferrer">TFS Blog Article</a> about this issue<br>\n<a href="http://social.msdn.microsoft.com/Forums/en-US/vststest/thread/fd6f2128-e248-4336-b8be-1eb5480e3de8/" rel="nofollow noreferrer">HowTo</a> edit the registry to change your computer name  </p>\n\n<p>The easiest approach is to tweak the registry. You need to edit two keys:</p>\n\n<pre><code>HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Control\\ComputerName\\ActiveComputerName\nHKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Control\\ComputerName\\ComputerName\n</code></pre>\n\n<p>Change value ComputerName to be upper case in both keys, and restart. Tests then magically work.</p>\n'}]
['https://Stackoverflow.com/questions/50746', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5289/']