I am attempting to debug a test, but it is not being executed
Warning 7/12/2012 9:16:53 AM Test run 'xxx#YYY 2012-07-12 09:14:52'
could not be executed. Timed out waiting for the process that runs
tests to initialize.
I however do not have any initializer code at all.
This was working previously, but I just modified Nuget in the solution to allow for Nuget Restore. I am unsure of whether this is the cause or not.
How can I debug through my test again?
I restarted my computer and my tests started debugging fine.
It looks like that Nuget Restore is the cause. In order to confirm it 100% disable Nuget Restore..
Also check if you have any setup methods in your tests (Check attribute [TestFixtureSetUp]). If so, put a breakpoint on them...
Related
Visual Studio Version 15.2 (26430.6) Release.
Having recently updated to the above version I am running into continuous issues with VS locking up files when trying to build.
Could not copy "obj\Debug\projHype.dll" to "bin\Debug\projHype.dll". Exceeded retry count of 10. Failed.
Also tried running VS2017 with and with out admin priveledges
I tried the suggestions for older versions of visual studio but to no avail. Any ideas how to get around this?
For anyone encountering this. Updating to version 26430.12 will resolve this. Looks like the previous release contained a bug.
While there may be other causes, testhost.exe and testhost.x86.exe can both result in a lock that prevents the build from completing. The symptoms are bewildering-- the test explorer churns indefinitely, sometimes timeout warnings appear in the build. Sometimes the files cannot be accessed even after VS is shut down.
If you are using nUnit or another test framework, make sure that test discovery does not encounter any infinite loops or crashes in your code. If this happens, it can hang the testhost executable. For example, if you use nUnit TestCase or TestCaseSource, if any of these perform an action that can hang, lock up, or crash, they will be invoked before the tests are executed.
This is the tricky bit-- your tests haven't run yet, but your code can lock up VS! While this may not be your problem, if you have unit test discovery in any way, check that it all completes.
One way to make sure all discovery completes is to use the functions from a test itself, and disable them as a TestCase or TestCaseSource (or equivalent in other test frameworks). If the test hangs or crashes, that's the culprit.
For me it helped to run the program again with accepting "run last successful build". After the run, the locks were gone.
The test explorer (MS-Test) kind of stopped working. It won’t discover any of my tests or sometimes only some of it. When I right click on my test and run it, the output window says “Run test finished: 1 run (time)”, but the test explorer would only display “Last Test Run Failed” (see screenshot), without information about which test or assert failed. I’ve tried restarting the VS, which I thought solved the issue once, but not currently. I’ve also tried build, rebuild, but I just can’t get it working again? Any idea what might help? All of this was working fine until early morning today...
Test Explorer has problems understanding test projects if they are build for x64 or x86, and solution is targeting a different platform.
Also, under Test > Test Settings > Default Test Architecture select appropriate value and then clean and rebuild.
I have a set of mstest unit tests, which use Trace.Write to collect some debugging information. And when I run it from VS2010 and then go to Test Run Details, there's Debug Trace section where I can see all my messages.
But when I run the same test from command line on the build machine, the trace is not recorded.
The things that I've tried:
Make sure that I'm in Debug configuration
/details command line switch with debugtrace, traceinfo etc options
I know about saving the traces to the file on the disk through the listeners, but I would like to find a solution to write
Has someone had a similar problem?
Try using Console.WriteLine instead. I've had this problem before with MSTest, and using the WriteLine worked for me - in that there was output available in the test result view.
No idea what other things like Debug.WriteLine or Trace.WriteLine didn't work, I never bothered to found out to be honest. (Well, I stopped using MSTest and moved to NUnit)
I recently run into problems when running all my unit tests at once.
I can debug them and run my tests seperate without problems, but when running them all together, the test-run keeps hanging half way through.
This happens:
"Run all tests in Solution"
The first tests parses without problem (slower then usual though)
At some point it gets stuck. Nothing fails, no exceptions, VS just stops running the pending tests.
When stopping the test-run it gets stuck again, and I need to restart VS to abort the test-run.
Normally I would expect a bug in my code, but I haven't made any changes to the code beeing testet since last succesful test-run. The only thing I did was run Performance Wizard - Cuncurrency profiling.
It always stops the same place, when removing some tests from the run it stops a new place (still without actually entering any leftover tests).
I have no clue what is causing this. But seems like I'm having problem with a VS setting rather then a code Error.
Any suggestions? Do Performance Wizard change any settings that might have influenced the way test should be run?
System details:
Windows 7 Ultimate 64-bit,
Visual Studio 10 Premium
This sounds like a concurrency issue. It seems that one test changes the testenvironment in such a way that another test runs into a deadlock. When you remove some tests, the test run order is changed and some other tests get stuck.
So I would look for a concurrency issue regarding your test environment/externall dependencies.
I can't really explain why this works, but it solved the problem!
I reversed the '.csproj' file to an earlier version, in one of the projects that had been in 'contact' with the Performance Wizard, and now my tests works.
ALSO Be aware of that Performance Wizard can change the solution configurations from 'DEBUG' to 'RELEASE' mode in some cases. This was not the case for me, but have been a pain for some of my colleagues.
I have been having some problems with the test debugger in VS10. All tests are running without error, but when debugging it aborts when I try to read the object data. Afterwards, this error is displayed in the summary: Test host process exited unexpectedly.
I'm unable to see anymore details about the error. How do I access/generate test-log files? Or, even better: Has anyone experienced a similar problem? And found a solution?
Additional information:
The runtime-test-data is available on objects from same libary assembly, it's just one class I can't get access to in runtime mode. If I use breakpoints at:
every line that affects the object: - I can see the runtime-data and the test passes
only one place: - the test will abort and no data is visible
no breakpoints: - the test runs and passes.
The test used to work fine until recently. Just before the problem occurred when I made some solution changes with dividing the projects into solution folders. I didn't make any changes that should affect the code. Moving the projects back to their original folder don't solve the problem, So I wonder - Is this a bug in Visual Studio itself?
Here is what I've tried so far:
Rebuilding and cleaning the solution.
Closing Visual Studio and rebooting my system.
Installing VS10 Service Pack 1
Reinstalling Visual Studio 10
Testing on VS10 Ultimate and Premium
Removing and regenerating solutions files
Removing all break points
TraceAndTestImpact/Local.testsettings: Testing Timeout > timeout and setting abort to 30 minutes.
TraceAndTestImpact/Local.testsettings: Unit Test > Assembly folders defined
TraceAndTestImpact/Local.testsettings: Deployment > Enable deployment directories and files
How can I fix this? Any suggestions are welcome.
What's most likely happening here is that a property, local which is being evaluated in the locals or autos window is causing a side effect in the running process which leads to the failure. To verify this you should turn off automatic property evaluation
Tools -> Options
Go to the Debugger menu
Uncheck "Enable Property evaluation and other implicit function calls"
Solution:
It had overridden ToString, and as it showed out, there was a loop i forgot to close.
After altering ToSting everything works fine.
Thank you very much for the answers :)
I was getting a similar issue, however in my case ALL tests were being skipped, and the error was reproducible on an empty test project, so code was ruled out.
Checking the EventViewer led me to the cause in my case; somehow the C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\QTAgent32.exe.config file had been removed from my machine?!? I copied one from another machine here and I'm back in action.
I was finally able to resolve this issue in my case. What was happening for me was I was running asynchronous threads, but closed a process using a synchronous Close() method for a powershell runspace rather than the asynchronous CloseAsync() method.