Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

VS2013 Hangs after debugging test fininshed
JohanSpannare
#1 Posted : Thursday, January 7, 2016 10:20:37 AM(UTC)
Rank: Member

Groups: Registered
Joined: 1/7/2016(UTC)
Posts: 10
Location: Sweden

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
VS2013 Hangs waiting on the TestHost451.x86.exe to terminate.

The process cant be terminated manually via Taskmanager either.

http://imgur.com/cfPsJXV

The only way to terminate it, is to close VS2013.


This start to occure after we switched on "Terminate test runner tasks.....". We did that because we have problem that if you stop debugging a test that has an active transaction. The transaction is not rolledback.

Best reg
Johan Spännare
Remco
#2 Posted : Thursday, January 7, 2016 11:09:46 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,000

Thanks: 932 times
Was thanked: 1259 time(s) in 1172 post(s)
Hi Johan,

I suspect this problem is likely to be related to the code being executed by the test host (i.e. your test code or code under test).

When NCrunch terminates a task runner process, it does so using a hard kill - the same as what you would do if trying to kill the process using task manager. If task manager cannot stop/kill the process, neither can NCrunch.

I recommend taking a look at the activities of this process at the time your test execution run completes. Check particularly for background threads in your code that may be calling into lower level APIs or O/S resources. Ensure that when your tests complete their execution, any state that might hang the process or interfere with its termination has been properly released.
JohanSpannare
#3 Posted : Friday, January 8, 2016 12:21:00 PM(UTC)
Rank: Member

Groups: Registered
Joined: 1/7/2016(UTC)
Posts: 10
Location: Sweden

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
I tried to attach to the process, but that didn't work. So i inspected the process via Process Explorer. And found this threads. No thread are running any application code what I can see. https://imgur.com/zzUUwb4

I got an assert exception i a test when it happen.

I submitted an bug report on this issue.

Johan
Remco
#4 Posted : Friday, January 8, 2016 10:52:21 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,000

Thanks: 932 times
Was thanked: 1259 time(s) in 1172 post(s)
Hi Johan,

Does this only happen when you attach a debugger to the process?

Does it happen consistently?

Do you see it happen on other solutions (i.e. a sample test project with a single empty test)?
JohanSpannare
#5 Posted : Monday, January 11, 2016 2:43:15 PM(UTC)
Rank: Member

Groups: Registered
Joined: 1/7/2016(UTC)
Posts: 10
Location: Sweden

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
Hi Remco!

It seams to me that it only occurs when we are debugging. Sadly it happen randomly, but often after been working for a half day without restarting VS. As I said before I have an dump file if you are interested.

I have not experienced it out side our two main solution files.

We currently have over 12K tests in 5 assemblies that ncrunch is monitoring.

Best reg
Johan
Remco
#6 Posted : Monday, January 11, 2016 9:38:37 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,000

Thanks: 932 times
Was thanked: 1259 time(s) in 1172 post(s)
Hi Johan,

The VS debugger unfortunately has a history of problems like this ...

MS regularly roll out fixes, but as the problems are often intermittent and environment specific, it's understandably hard to pin them down and resolve them all. The debugger is also subject to other constraints introduced at a low level. It wouldn't be surprised if your SQL transactions were somehow related to this.

NCrunch's integration with the debugger is actually minimal. When requested to run a test with a debugger, NCrunch will launch the test process, then make a call to the IDE to tell it to attach to the process before any test execution begins. When the test execution is complete, NCrunch calls EnvDTE.Process.Detach().

Unfortunately there's very little I can do to help with problems in the debugger itself. Although NCrunch may be surfacing the issue on your system, the workings of the debugger is outside the boundary of what I'm able to troubleshoot.

It may be worth trying a reset of your VS settings to see if this solves the issue - https://social.msdn.microsoft.com/Forums/sqlserver/en-US/3cc5813e-363b-4ab0-85db-5c35ad092aa0/visual-studio-hangs-up-after-stop-debug.
JohanSpannare
#7 Posted : Tuesday, January 12, 2016 7:38:55 AM(UTC)
Rank: Member

Groups: Registered
Joined: 1/7/2016(UTC)
Posts: 10
Location: Sweden

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
I will try resetting VS settings and see if it resolves the problem.

Best reg
Johan Spännare

Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.042 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download