ReleaseHandleFailed was detected when debugging with MSTest - visual-studio-2010

When I run my unit tests in debug mode, I get a recurrent exception like this:
I click "Continue" and then the test goes on without any problem. I have to do this around 10 to 15 times per test I want to debug. If I simple RUN the test, I get no exception whatsoever.
The test does well anyway, I click "Continue" on the recurrent exception and the test ends gracefully.
The exception has no stack trace. All the information I can get about it is in that screenshot. Even if I choose to "Copy MDA message to clipboard", it is the same as appears on the screenshoot.
The test is using Entity Framework Code First, and dropping and creating the database each time.
What could be the problem? I am not using any kind of encryption, but the test connects to the SqlServer and do some operations with it.
Thanks.

I got to disable the warning: http://msdn.microsoft.com/en-us/library/d21c150d.aspx
But I would like to know what is going on.
Cheers.

Related

Identify jenkins error messages for failed tests and debugging

Is it possible to find out why the tests on the jenkins server failed? Meaning like an error message? I am new to testing and although I did some front end testing with Chutzpah, this is a totally new concept. Could someone please throw a light on this?Also, is there anyway to debug my tests in jenkins?
I am running my tests on visual studio and all the tests are passing but when I run them on jenkins, I see that some of them are failing and some of them are passing
There should be a "Console log" link on each test; click on that.
As Oli Charlesworth sad use the "console log" (+1) there you get (nearly) same errors like in VS. Mostly I scroll down to the end of the log and search for the error bottom up, because the error is usually one of the last actions.
I do not know anyway how you can debug tests in Jenkins.

Getting object reference error in my MVP application

I am receiving random object reference error in different modules of my application.The errors m facing is intermittent. I did debug of my code it looks all correct. Moreover, whenever I run into that error and I try again (immediately after I got error) with same steps with same input conditions that error does not come up. This is something which is happening not only in in development regions but also in production regions. I tried to analyze and I got some leads that there might be problem with temporary ASP. But I don't know how that can cause object reference errors. Sometimes I see Source error information like App_Web_ighjds[some kind of ID I guess]. I don't know where exactly the problem is? As far as my code is concerned It looks all fine. I believe if there was problem with my code then it should be reproducible every time. Does anybody have any idea why such error might be happening? If it is issue with temporary asp.net files then what I should do to avoid such error?? Any help is much appreciated. Thanks.
You're looking for ideas: I would suspect your module initializers or any DI container initialization.
Look for code that runs only on application start.
I would recommend to reset your web server completely before starting new debugging session.
I would also recommend setting Visual Studio debugger to "Break when an exception is thrown", by going to "Exceptions" settings (Ctrl-Alt-E) and checking the "CLR Exception" "Thrown" checkbox.

no error messages in xcode?

I'm coming from using visual studio. When I run in XCode and I get an error, it just says something like SIGABRT, but there are no helpful error messages like in VS, it doesn't point me to any code. There is just a list of memory addresses and threads.
How do I make it display messages like VS?
You put in your own error catchers, or use breakpoints. There's no way to make it give you helpful error messages. The best you can usually do is figure out which line it failed on, through trial and error using breakpoints.
You should look at Exception Breakpoints. Usually you want to add an exception throw Breakpoint to see which line threw the exception. More details in this answer: Xcode doesn't show the line that causes a crash
You should also always scan your code for errors and post some code! If you don't post code, most of the times nobody will be able to help you, especially when the problem is a code related crash.

How to debug a program that doesn’t throw any error

I’m having trouble to find a bug in my application.
The problem is random and don’t throw any error. The web site just keeps loading and loading and eventually gets a timeout.
Is a web application using MVC 3 in VS 2010 Pro.
Some time ago, I see a friend to write something in the url, and gets all the trace of the program…
Sadly, I don’t remember what the command was.
Anyone has an idea of what command is it?
Any suggestion on what to use to debug?
Thanks!
Edgar.
UPDATE!
I finally found the command... is trace.axd
But Its behave the same way... sometimes load without problems and show me all the trace info... and sometimes.. it keep loading and loading...
Maybe something related with IIS?
Turn on break on every thrown exception, run your application in debug mode and wait. If it executes too long then pause application and check where you are or wait for exception that is handled somewhere.
Your friend may have had something like the following built into his application, to dynamically set tracing on.
Trace.IsEnabled = Request.QueryString["trace"] != null ? true : false;
This provides info only if the page is fully loaded. It's probably best if you use the VS debugger to step through code.
If all you loops look ok, investigate code that could result in circular references or deadlocks. These can be difficult to spot sometimes, look for functions or constructors that require results from a calling class. So code that needs the result from a function which in turn need results from the first.
Well, this sounds like you have an infinite loop somewhere.
Look at the code that runs when you visit the URL that gives you trouble. See if there is any loops in there (for/while). If yes, see why if they never exit. You can do this by putting a breakpoint inside the loop and examining its behavior over the iterations.
in MVC the bugs you do not see are most of time (especially in Razor and Ajax work) view compile errors. Sometimes syntax bugs on views just does not show that view and do not stop working.
Try that:
put a breakpoint in view.
If program stops in there it means this view is working. Othervise there is a syntax error in this view.
Another way to see some bug information more than in visual studio is use browser tools.
I use google Chrome. Just open developer tools in it. Open network. And do your request. It will list the requests and responses. Click the response and see the information. After style (it is written Verdana etc) read exception details. Sometimes there is more information :)
I am using MVC 3 in Razor from start. So this is a small bug in asp.net mvc.

Is there a way to freeeze Selenium-RC execution on error?

My Google-fu is weak and so I turn to the hive mind...
I have a Selenium script I originally developed in the IDE, which I am now trying to adapt to run on IE8 via Selenium-RC. I'm trying to debug an error where an element is not being found.
The problem is that as soon as the error occurs, the script exits and RC closes the browser. This makes it a bit hard to poke around with Firebug, etc, to see what is going on under the covers.
In the IDE, I could simply set a breakpoint. Is there a way to freeze the state of RC and the browser when an error occurs?
Any other ideas?
Thanks!
Depending on how you're running your RC tests, you could set a breakpoint in your IDE and run the test in debug mode. For example I use Eclipse to run tests using Java. Another option is to put a long pause in your test, just make sure you remove it again afterwards..!
I am running selenium rc tests as part of my test suite, so I just fire up --pdb (in python) and script pauses when exception occurs - before tearDown that closes the browser is invoked.
I have also had a plugin where I took a screenshot when something went wrong.
If you are using JUnit and SeleniumTestCase, you can add an empty tear down method to your test code which should prevent the browser from shutting down by overriding the base SeleniumTestCase tear down method. I use this on failing tests which I need to examine the resulting browser state after a failure.
In these situations I comment out the selenium.close() and selenium.stop() commands in my code which stops the browser from closing.
IIRC screenshot is only supported for firefox, so that won't help in your case.

Resources