Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unit Tests Stopped Working and Stuck in Pending State VS2012

I have a somewhat major issue here and I have no idea how to debug the problem. First off I am running VS2012 Update 2 (v11.0.60315.01). Unit Tests had been running and I noticed today that they quit working. I was working on something different past week or so so it's been at least a week or 2 since I last ran any unit tests.

All of the tests are stuck in the Pending state in the Unit Test Session window. I even tried spinning up a new test harness and running some simple unit tests. They behave identically, so I don't think this is a single solution issue.

I have obviously rebooted the machine which included restarting VS.NET 2012 as well. I'm not getting any errors, messages, problems, etc. The unit tests are all just stuck in the Pending state and none of them will run.

I ran the .dll that comprises my tests using the vstest.console.exe tool and I get the result "Test Run Successful", "Test execution time: 0.4952 seconds". OK, this tells me I have a problem with VS2012 because the tests run independently using the command line.

How can I debug this issue? I see solutions for deleting settings files for individual solutions but this seems like an issue across the board with VS2012. Any suggestion on how to fix this?

like image 427
atconway Avatar asked Apr 16 '13 19:04

atconway


People also ask

What happens if unit testing is not done?

If any of the unit tests have failed then the QA team should not accept that build for verification. If we set this as a standard process, many defects would be caught in the early development cycle, thereby saving much testing time. I know many developers hate to write unit tests.

How long should unit tests run?

Still, it seems as though a 10 second short-term attention span is more or less hard-wired into the human brain. Thus, a unit test suite used for TDD should run in less than 10 seconds. If it's slower, you'll be less productive because you'll constantly lose focus.

How do I run all unit tests in Visual Studio?

To run all the tests in a default group, choose the Run icon and then choose the group on the menu. Select the individual tests that you want to run, open the right-click menu for a selected test and then choose Run Selected Tests (or press Ctrl + R, T).


2 Answers

If you're using Resharper, then there is an issue with version 7.1.2 and below in combination with Visual Studio 2012 Update 2.

Jetbrains has released a new version (7.1.3) which solved the issue, the latest EAP also resolved this issue.

If you're running an older version of Visual Studio 2012 and are experiencing these issues with Resharper 8, then make sure you install Visual Studio Update 2 at the least. If I had to choose, I'd always install the latest version, which would be Visual Studio 2012 Update 4

like image 58
jessehouwing Avatar answered Oct 01 '22 02:10

jessehouwing


The 7.1.3 version of Resharper also works following Update 3 for Visual Studio 2012. Not sure about the newest version 8 but that older version is still available for download here.

like image 25
sharptooth Avatar answered Oct 01 '22 03:10

sharptooth