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

Notification

Icon
Error

Sometimes NCrunch discovers no tests in a test project
FrankShearar
#1 Posted : Wednesday, April 27, 2016 11:17:10 PM(UTC)
Rank: Member

Groups: Registered
Joined: 1/20/2015(UTC)
Posts: 17
Location: United Kingdom

Was thanked: 2 time(s) in 2 post(s)
We have a pretty large test suite in a project - around 7k tests, once you've counted all the parameterised tests. Occasionally (maybe a few times a week?) NCrunch will fail to discover any tests in the project.

Sometimes, "Reload and rebuild configured component" will fix things. Sometimes I have to "Reload and rebuild configured component" and then _while this is reloading_, "Run selected tests in new task runner process".

Could it be that NCrunch has a timeout in its test discovery phase? How verbose should I crank NCrunch's diagnostics to provide something useful for debugging?
Remco
#2 Posted : Wednesday, April 27, 2016 11:23:59 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)
Hi, thanks for sharing this issue.

When the analysis fails, how does NCrunch behave for you? Do you receive an error of some kind? Or do all your tests just suddenly disappear?

Are you using distributed processing?

Which test framework are you using?

Are you making use of any complex code to dynamically construct your tests? (i.e. NUnit TestCaseSource)
FrankShearar
#4 Posted : Wednesday, April 27, 2016 11:50:47 PM(UTC)
Rank: Member

Groups: Registered
Joined: 1/20/2015(UTC)
Posts: 17
Location: United Kingdom

Was thanked: 2 time(s) in 2 post(s)
There are no errors: it just doesn't find any tests in the affected project. I am using distributed processing, with NUnit, and am using TestCaseSource.
Remco
#5 Posted : Thursday, April 28, 2016 1:45:09 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)
FrankShearar;8691 wrote:
There are no errors: it just doesn't find any tests in the affected project. I am using distributed processing, with NUnit, and am using TestCaseSource.


Try the following:

When you start your NCrunch session, go to your configuration and set your 'Log Verbosity' to 'Detailed'. You'll need to do this at the start of each session, as the engine will automatically reset this value when it initialises (as this setting has a big impact on performance).

When the problem appears, go to your Processing Queue Window and look for the Analysis Task representing the test project experiencing the problem. Click on the task so its trace data shows in the pane below. Do you see anything interesting in this trace data? It would be great if you could copy/paste it here or submit it through the contract form.

I'm also interested in knowing whether the problem appears when you're not using distributed processing. If the conditions on the grid node server are somehow different to your client machine in a way that causes it to not detect the tests, this could explain the intermittent behaviour. When you are using distributed processing, sometimes NCrunch will take the discovery results from the node, and sometimes it will take them from the client machine (depending on which finishes first). Trying to work exclusively using certain nodes or the local client machine would be a good way of narrowing down a problem like this.
FrankShearar
#6 Posted : Saturday, April 30, 2016 4:33:31 AM(UTC)
Rank: Member

Groups: Registered
Joined: 1/20/2015(UTC)
Posts: 17
Location: United Kingdom

Was thanked: 2 time(s) in 2 post(s)
I've seen it happen a few times since the report, but unfortunately haven't caught it in the act with diagnostics yet. It does seem to happen most frequently during reloading as a result of a git checkout.
Remco
#7 Posted : Saturday, April 30, 2016 7:27:00 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)
FrankShearar;8707 wrote:
I've seen it happen a few times since the report, but unfortunately haven't caught it in the act with diagnostics yet. It does seem to happen most frequently during reloading as a result of a git checkout.


You mentioned that you are using TestCaseSource, are you using it for all the tests that are not being reported? Is there much complexity behind the generation of the tests?
FrankShearar
#8 Posted : Tuesday, May 10, 2016 6:53:49 PM(UTC)
Rank: Member

Groups: Registered
Joined: 1/20/2015(UTC)
Posts: 17
Location: United Kingdom

Was thanked: 2 time(s) in 2 post(s)
We do have some relatively complex TestCaseSource implementations, but they're not expensive: there's no database/network accessing stuff, just creating complicated domain objects.

Is it possible to hook into NCrunch's diagnostic output? I could add some instrumentation to the more complicated TestCaseSource implementations, and see typical execution times.
Remco
#9 Posted : Tuesday, May 10, 2016 11:34:07 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)
FrankShearar;8719 wrote:
We do have some relatively complex TestCaseSource implementations, but they're not expensive: there's no database/network accessing stuff, just creating complicated domain objects.

Is it possible to hook into NCrunch's diagnostic output? I could add some instrumentation to the more complicated TestCaseSource implementations, and see typical execution times.


From the top of my head, I don't think it's possible to feed additional information into the NCrunch trace log during its discovery step .. but there would be nothing stopping you from creating your own log file in a known location.

Do you have other tests in the same suite that are not using TestCaseSource? If so, I would find it strange if you've managed to find a TestCaseSource error that could prevent NUnit from discovering everything within the suite ... there must be an exception kicked up somewhere. I think that obtaining a diagnostic log of the discovery task would be very helpful in analysing this problem.
FrankShearar
#3 Posted : Tuesday, August 16, 2016 7:06:33 PM(UTC)
Rank: Member

Groups: Registered
Joined: 1/20/2015(UTC)
Posts: 17
Location: United Kingdom

Was thanked: 2 time(s) in 2 post(s)
Remco;8690 wrote:
Are you using distributed processing?


We are, but I just ran into this issue _without_ using distributed processing.
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.045 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download