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

Notification

Icon
Error

NCrunch gets stuck after switching solutions
willapp
#1 Posted : Tuesday, November 22, 2016 9:29:26 AM(UTC)
Rank: Member

Groups: Registered
Joined: 7/27/2012(UTC)
Posts: 15
Location: UK

Was thanked: 4 time(s) in 4 post(s)
Only had this problem since the latest version (2.27.0.3).

If NCrunch is running and I open another solution within the same instance of the IDE, once the solution has opened NCrunch seems to get stuck - on the menu I see that "Disable NCrunch" is greyed out but there is no activity at all in the tests window and using Task Manager I see only the nCrunch.EngineHost process which is idle (have left for > 5 minutes and it doesn't recover). Killing the EngineHost process kicks it back into life (process is restarted and NCrunch resumes itself).

I can't be sure this has happened every single time but it's often enough to be a nuisance as I change solution frequently. I suspect closing down the IDE then opening the solution in a new instance might solve it but this isn't ideal.
Remco
#2 Posted : Tuesday, November 22, 2016 10:11:31 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Hi, thank for sharing this issue.

These symptoms suggest that the engine host seems to be encountering a problem when trying to shut itself down. This is not normal behaviour. I'm wondering if you might be able to collect some more information for me to help narrow down this problem:

- Can you try submitting an NCrunch bug report once the engine is in a hung state after trying to shut down? If the process is still partly functioning, we may be able to extract a log from it
- Does the problem appear if you close down the solution, wait for a few seconds, then open the other solution instead of swapping directly between them?
- Can you notice any pattern around when the problem appears? For example, does it seem to be tied to the closing down of a specific solution?
- How large is the NCrunch .cache file for the solutions involved? (can be found in the _NCrunch directory next to your solution file)

Changing your 'Engine hosting strategy' global config setting to 'HostInIDE' will change the workflow around how the engine shuts itself down. This may give you a way to work around the problem, and it might also be useful to know if the problem can still appear with this setting changed.
willapp
#3 Posted : Tuesday, November 22, 2016 10:47:12 AM(UTC)
Rank: Member

Groups: Registered
Joined: 7/27/2012(UTC)
Posts: 15
Location: UK

Was thanked: 4 time(s) in 4 post(s)
Hi Remco,

I may have to apologise. I've been working on a temporary laptop which is quite low powered, I thought I had reproduced the issue just now but it seems that eventually the NCrunch process does kick back into life although it takes a very long time (over 5 minutes).

If it helps to look into the performance aspect, closing the first solution before opening the next one does seem significantly faster. The solutions are reasonably large (15 - 20 projects) and the cache files are between 35 - 50Mb.
Remco
#4 Posted : Tuesday, November 22, 2016 11:20:52 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Thanks for the extra details. So I guess this is a performance issue then. Here's something we can try:

1. Just before you close the solution, go to your NCrunch global configuration settings and turn on 'Log to output window'. Set the log verbosity to 'Detailed'.
2. Then close the solution and wait for a few minutes for the engine to completely shut down
3. Open the Visual studio output window and choose the NCrunch diagnostic output
4. This should show a detailed log of everything the engine does while it's shutting down
5. You're very welcome to thumb through this to see if you can find where it's stuck at, or alternatively, you can zip up the log and send it through the contact form and I'll take a look.
willapp
#5 Posted : Tuesday, November 22, 2016 11:45:37 AM(UTC)
Rank: Member

Groups: Registered
Joined: 7/27/2012(UTC)
Posts: 15
Location: UK

Was thanked: 4 time(s) in 4 post(s)
Cheers, have submitted the log output via contact form as requested. Looks like it takes 5 minutes to shut NCrunch down on my laptop.
Remco
#6 Posted : Tuesday, November 22, 2016 9:38:35 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Thanks for sending through the log! This was very revealing.

NCrunch is taking an insanely long time to clean up its workspaces. For example:

ENGINE - [11:30:49.7694-Core-44] Cleaning up workspace: D:\Stash\NCrunch\11136\3
ENGINE - [11:31:17.2331-Core-44] Publishing Event: [WorkspaceDeletedEvent:D:\Stash\NCrunch\11136\3]

Normally, on a desktop machine, it takes less than a couple of seconds to clean up a workspace. Because the delay seems to be so high for all of your workspaces rather than just one, I think this may be a system-wide/hardware performance issue.

Do you have your workspace base path set to an external USB drive? Even for a low spec machine, these cleanup times are pretty extreme. Your antivirus may be suspect, though it does seem strange that an antivirus would take issue to directories being deleted.

You may want to consider using NCrunch's distributed processing feature to offload the work onto a different machine. I don't doubt that this I/O issue will also impact the performance of the engine when it runs.
willapp
#7 Posted : Tuesday, November 22, 2016 10:22:58 PM(UTC)
Rank: Member

Groups: Registered
Joined: 7/27/2012(UTC)
Posts: 15
Location: UK

Was thanked: 4 time(s) in 4 post(s)
I think you're right about it being an IO issue, NCrunch is generally quite slow on that laptop. Luckily I've got my main one back now so I'll do a comparison tomorrow. It'll have the same AV running but the new laptop has an SSD whereas I'm not sure the old one does which would explain a lot.

Cheers for helping though and I'll let you know if the other laptop is okay so you can put this issue to rest.
1 user thanked willapp for this useful post.
Remco on 11/23/2016(UTC)
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.043 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download