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

Notification

Icon
Error

Problems with Visual Studio 2022
NeilMacMullen
#1 Posted : Tuesday, October 26, 2021 3:50:58 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 12/15/2016(UTC)
Posts: 34
Location: United Kingdom

Thanks: 18 times
Was thanked: 9 time(s) in 8 post(s)
Ncrunch is exhibiting a number of odd behaviours for me since upgrading to VS2022 preview and Ncrunch 4.10...


1) A test marked as Explicit is being run. (I'm not editing this test file so it's not a matter of Ncrunch seeing the test before the Explicit atttribute is added)
2) I'm not convinced Ncrunch is obeying the "IsEnabled" flag in distributed processing. I turned off the local server and yet a lot of the builds steps still seem to be run on it (though perhaps it's just that this flag is only checked at startup?)
3) Possibly related to #2, I'm finding that Ncrunch is sometimes hanging on rebuilds... For example Ncrunch is currently stuck on "build in progress" and the top 4 tasks in the processing queue are "Build Assembly" on the local server with status "Reprocessing".

If I get a bit of time I'll try reverting to VS2019 to see if the issues is with the Visual Studio upgrade.
1 user thanked NeilMacMullen for this useful post.
arkiaconsulting on 10/27/2021(UTC)
Remco
#2 Posted : Wednesday, October 27, 2021 12:02:14 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,473

Thanks: 847 times
Was thanked: 1145 time(s) in 1069 post(s)
Hi, thanks for sharing these issues.

In the cases of 1 and 2, the changes for VS2022 haven't included any changes to these areas of NCrunch. I think there might have been a change in usage here that is surfacing something unexpected.

Explicit tests will be run by NCrunch when they are specifically targeted in the NCrunch Tests Window. They won't run automatically. It should be possible to check whether NCrunch has correctly detected the 'IsExplicit' tag by adding the 'Is Explicit' column to the Tests Window and checking the status of the child test. If there's a problem with test discovery, it should show up here.

The 'Is Enabled' flag can be disrespected by NCrunch when a test is targeted for priority execution and no grid node is able to run it. This will happen if you try to debug any test, and doing so will cause NCrunch to build any related projects locally so that it can build an environment for the test run.

Issue 3 is a cause for concern and could be related to the change in underlying platform. Does NCrunch give you any error information for these tasks under the Processing Queue Window?
NeilMacMullen
#3 Posted : Wednesday, October 27, 2021 10:47:41 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 12/15/2016(UTC)
Posts: 34
Location: United Kingdom

Thanks: 18 times
Was thanked: 9 time(s) in 8 post(s)
Thanks Remco, I saw this again this morning (after upgrading to 2022 pv7).

I can't come up with an explanation of why the original explicit test was run (it's *possible* I accidentally right-clicked and chose "Run") but your explanation does at least satisfy item 2.

As far as the "hanging" (#3) is concerned.

I'm not sure if this a "reliable" recipe and some steps may be red herrings. but I seem to be able to reproduce the issue sometimes by:

- Unclicking "Is Enabled" for the local server in the distributed processing tab.
- Restarting ncrunch (disable then enable)
- Let all tests run (and successfully pass)
- Right click on a single test and Choose "Debug/Run selected test as high priority task"

At that point the processing queue shows 3 x "Build Assembly" tasks with "Processing" status. All using the same process id. If it's relevant, the declared task-capacity of "local" is 2.

> Does NCrunch give you any error information for these tasks under the Processing Queue Window?

If I click on the tasks, no additional information is shown in the split panel below the list. (Maybe there's another way to get some insight into the task status?)



Note that if I _enable_ local and restart ncrunch, the same projects can be built fine and run/debugged.

So the workaround _seems_ to be to keep the local server enabled but I'll post back if that turns out to be insufficient.
Remco
#4 Posted : Thursday, October 28, 2021 1:04:12 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,473

Thanks: 847 times
Was thanked: 1145 time(s) in 1069 post(s)
Thanks for the extra detail here. Based on your description, I've successfully reproduced this problem and implemented a fix for it. The issue was caused by an oversight in how threading resources are managed when working in grid only mode. The build tasks were being starved of threads when trying to instrument, and they were hanging. I'll be deploying this fix with the next build we manage to get through the system.

It should be possible to work around this problem by increasing the 'Max number of processing threads' setting on your client machine when you're working in grid only mode. This will raise the threshold for the threads involved and will prevent the starvation.
1 user thanked Remco for this useful post.
NeilMacMullen on 10/28/2021(UTC)
NeilMacMullen
#5 Posted : Thursday, October 28, 2021 3:24:04 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 12/15/2016(UTC)
Posts: 34
Location: United Kingdom

Thanks: 18 times
Was thanked: 9 time(s) in 8 post(s)
Super - that's great to hear. Thanks for such a quick fix :-)
Remco
#6 Posted : Friday, October 29, 2021 4:26:35 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,473

Thanks: 847 times
Was thanked: 1145 time(s) in 1069 post(s)
1 user thanked Remco for this useful post.
NeilMacMullen on 10/29/2021(UTC)
NeilMacMullen
#7 Posted : Friday, October 29, 2021 11:31:14 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 12/15/2016(UTC)
Posts: 34
Location: United Kingdom

Thanks: 18 times
Was thanked: 9 time(s) in 8 post(s)
Thanks Remco. First impressions are encouraging - I haven't been able to reproduce the issue with 4.11.01 :thumb:
1 user thanked NeilMacMullen for this useful post.
Remco on 10/29/2021(UTC)
arkiaconsulting
#8 Posted : Wednesday, November 3, 2021 9:09:22 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 11/30/2019(UTC)
Posts: 3
Location: France

Thanks: 2 times
Was thanked: 5 time(s) in 2 post(s)
Thanks Remco, I confirm that this is resolved in 4.11.0.2.

PS: It's always a pleasure to pay for an NCrunch license !
1 user thanked arkiaconsulting for this useful post.
Remco on 11/3/2021(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.055 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download