Visual Studio 2015 RC Test Run hangs - visual-studio

Found a strange issue in VS 2015 - running a single unit test hangs if previous test run were interrupted by Stop Debugging.
Steps are:
Set a breakpoint on the first line of some test method.
Start that test under debugger, wait for breakpoint hit.
Hit Shift+F5 or Debugging/Stop Debugging.
Start that single test again - it hangs on start somewhere in te.processhost.managed.exe native code.
Restarting the VS or just running all tests by hitting Run All helps, but only until the next Shift+F5 hit.
I was able to reproduce it both locally and on clean Azure VS 2015 RC VM, so it looks like a but, not just some machine-specific glitch.
Switching Test / Test Settings / Default Processor Architecture from default X86 to X64 works for me, as it enables old vstest execution engine.
This issue on MS Connect Site.
Are there are any other known workarounds?

Related

How to run tests while debugging

I've been using ReSharper test runner in Visual Studio for quite a while, and there is one thing about it that I can't figure out.
I used to have some integrational tests in my solution that performed web requests to my local web server. I used to be able to launch my web application in debug mode, then launch a test with Resharper test runner within the same Visual Studio instance (that was currently running a debug session), and the test would run normally. The breakpoints in my application were hit, and I was able to debug the requests sent from the test.
However, when I was trying to do the same thing for a new project, the tests fail to launch. When I run any test, Visual Studio displays a modal window asking Do you want to stop debugging?. Why am I unable to run tests while having an active debugging session anymore? What does the ability to do this depend on? Visual Studio version? Resharper version? Unit testing framework (I'm currently using MSTest)?
I think I've seen this behavior before, it seemed to be driven by the fact that Resharper was feeling the need to always build my project/solution before running tests.
Try changing the Build Policy to Never (at first at least) from the Unit Test Sessions window:

Visual Studio Unit Test: Huge startup delay in debug Mode

I'm working on a big code project. When I try to run a unit test in debug mode using nunit on Visual Studio 2013 Ultimate, there's a consistent 40 second delay before the test runs. Now, once the test starts running, it runs as fast as I'd expect. And if I run the test in Release mode, there's no delay.
I know it's a local environment problem because other developers report no similar delay when they fire up a test on the project.
I've been unable to determine what's causing this delay. The only visual evidence is that the cursor changes to a spinning cursor. I've disabled everything in Options that looked like it might be demanding. I have NCrunch and Resharper installed, but both are disabled, so neither appears to be at fault.
Any suggestions?

How to prevent Visual Studio from killing any process after test execution

I am using Visual Studio 2012 MSTest framework with Silk4NET plug in. Every time when a test case finishes running, the Application Under Test is killed. This is REALLY annoying because this makes inspection harder in that I have to re-run the test and have to manually stop the test code to investigate the issue.
Does anybody know if I can disable this feature in VS where it kills everything after test execution? Thank you!
You need to add a line to the test that sets CloseOnPlaybackCleanup flag to false:
browserWindowInstance.CloseOnPlaybackCleanup = false;
This flag was added in Visual Studio 2010 SP1. Here is an MSDN Blog post.

Debugging code that's being tested in Visual Studio 2010

I am having some problems with a given test, that I'd like to debug the code that is being tested, while the test runs.
Is this possible?
If yes, how can I just debug this one test? I can only see options for running or the whole solution, or the whole set of tests in the current context or all impacted tests. I'd like to just run this one test, if possible!
I'm running Visual Studio 2010.
Put a breakpoint in the test and run the test with debug - use the test explorer to select just that test and "run selected".
See this MSDN page (How to: Run Automated Tests from Microsoft Visual Studio).

Visual Studio 2010 locks up when running unit tests

I'm running MSTest unit tests in VS2010 and whenever I do the VS IDE locks us and goes to '(Not Responding)' if I try to click on it anywhere.
The tests run fine on other people's computers with the same OS (Win7) and the same version of VS2010, has anyone run across this before? Any idea how to debug this?
Update: Should mention, I can debug the tests, just not run them without debuging

Resources