Reputation: 3336
I have a VS2012/.NET4.5 solution with huge number of unit tests
When running All unit tests from solution I am randomly getting "QTAgent32.exe has stopped working" error message and unit tests hangs at this point.
My unit tests are actually MSTest and I run them using Resharper menu from VS. Resharper Edition is 7.1.3, not sure if it matters. VS 2012 SP 3
Upvotes: 11
Views: 14304
Reputation: 2172
In my case I had an async
test that had a cleanup after the assert
statement. The test was always green (passed) but after every execution the 'QTAgent32.exe has stopped working'
error appeared.
After the assert
statement I called a method on an object that was null
. I think it's due to the behavior of the async
test that the NullReferenceException
was swallowed.
I found the issue by simply debugging the test. Maybe this will help someone in the future.
Upvotes: 0
Reputation: 7692
FWIW: My solution in VS2012 was to remove my TraceAndTestImpact.testsettings
file in the solutions directory. (possibly together with removing MySolutionName.sln.DotSettings.user
and running with elevated privileges)
If you get the following,
An exception occurred while test discoverer 'MSTestDiscoverer' was loading tests.
Exception: An error occurred while initializing the settings provider named 'MSTest'.
Error: The test settings file C:\....\TraceAndTestImpact.testsettings, specified in
the MSTestAdapter settings, is not available. Either access to the file is denied or
the file does not exist. Ensure that the test settings file is available and try again.
try loading the solution with elevated privileges. To add insult to injury no new TraceAndTestImpact.testsettings
file is created.
Upvotes: 2
Reputation: 30790
I had the same issue and the problem was some tests that had Thread.Sleep
inside a ThreadPool.QueueUserWorkItem
.
I've found where the error was after removing the test configuration file: my-project.testsettings. Deleting this file stopped the QTAgent32.exe has stopped working message and started showing the exception about the thread being aborted.
Upvotes: 1
Reputation: 1
Same happened to me after rebooting my PC, running Visual Studio Professional 2013 Update 2. Even the simplest test failed before it was entered and the message "QTAgent32.exe has stopped working" came up.
Running Visual Studio as Administrator solved the problem for me. Probably only removing the symptom not the cause, but it worked.
Upvotes: 0
Reputation: 16909
I had a similar problem, so I will present the solution here for anyone else with the same problem.
I would get "QTAgent32.exe has stopped working" whenever trying to run any unit test. This started after I reorganized my solution by pulling out some code into a class library.
This was for a .NET 3.5 solution in VS Premium 2012, update 4.
The fix in the end was to delete the suo file. (This is a hidden file, by the way.)
Upvotes: 4
Reputation: 3336
Eventually I found the reason
One piece of code was written incorrectly and under some curcumstances caused endless recursion and stack overflow. So if you getting the same error "QTAgent32.exe has stopped working" try to check what is your call stak at this point.
Upvotes: 8