views:

558

answers:

3

I've got a bunch of unit tests built using Visual Studio 2005's built-in unit testing functionality. For the last little while, it's been taking absolutely forever to start the tests... Everything just sits there at "Pending" for two minutes or more. Now Visual Studio's decided to take things to a new level and never even start the tests. After two to three minutes, it aborts the run and barfs an error message into the log:

Failed to Queue Test Run '(blahblahblah)' with id {bfba05b1-afe5-499e-b452-29167f414f0f}: Microsoft.VisualStudio.TestTools.TestManagement.ExecutionException: Failed to establish communication environment for local run.

Anyone have any ideas? In the medium term, we are planning to switch to NUnit, but for now I'd prefer to stick to Visual Studio because the rest of the team already has that installed and that makes it easier to convince them to actually run the tests... ;-)

A: 

Let me say this MS TEST is not a professional product and should be avoided whenever possible. If you want to use a good testing framework then use MBUnit with TestDriven.NET. MBUnit comes with many new attributes including RollBack and RowTest , Row.

Also, TestDriven.NET will allow you to debug your unit tests (How cool is that). You can also run the code coverage from TestDriven.NET which shows you how much of your code is covered under tests.

Give it a try I am sure you like it.

PS: IT is FREEE

azamsharp
As I mentioned, we're already planning to switch to NUnit, but for various reasons that's not happening for a little while. In the meantime, I still need my tests to keep working in MSTest.
canuckotter
+1  A: 

Is your computer name UPPERCASE? change it to lower case and try it again.

Shay Erlichmen
+1  A: 

I've experienced this problem. However, for me the answer was to change my machine name from all lowercase to all UPPERCASE.

Some references for this... http://teamfoundation.blogspot.com/2008/12/case-of-never-ending-unit-tests.html http://social.msdn.microsoft.com/Forums/en-US/vststest/thread/fd6f2128-e248-4336-b8be-1eb5480e3de8/

Note, that if you're just changing the case of the machine name then you'll need to use the registry method of changing name as the dialog box will grey-out the OK button when it sees what looks like the same name.

Martin Peck