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

Notification

Icon
Error

NUnit3 on distributed nodes or multiple threads unstable
KGreene
#1 Posted : Wednesday, March 23, 2016 9:49:04 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 3/23/2016(UTC)
Posts: 4
Location: United Kingdom

Was thanked: 1 time(s) in 1 post(s)
When NCrunch 2.19.0.4 on distributed nodes, or running more than one thread locally, I am seeing many spurious failures with the message:
"This test was not executed during a planned execution run. Ensure your test project is stable and does not contain issues in initialisation/teardown fixtures."

This appears to only have started happening after a recent update from NUnit 2.6.3 to NUnit 3.2.0.

Many of these tests have no init/teardown, and appear stable and stateless.

Running these tests "manually" (i.e. right clicking and "Run selected task in a new task runner process") makes it go green.

If I disable my connection to all distributed nodes, and force all tests to run locally on one thread, this problem appears to go away.
Remco
#2 Posted : Wednesday, March 23, 2016 11:04:48 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
Hi,

Could you confirm whether this issue exists for you with the latest version of NCrunch (v2.20)?

If so, do you notice any pattern as to which tests are causing this problem? Are you making use of any of NUnit3's parallelization features?
KGreene
#3 Posted : Wednesday, March 23, 2016 11:38:38 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 3/23/2016(UTC)
Posts: 4
Location: United Kingdom

Was thanked: 1 time(s) in 1 post(s)
Thanks for the quick reply.

Using 2.20 appears to allow me to run multiple threads locally, but it fails in the same way on distributed nodes - so it is an improvement over having to run a single thread locally.

I've tried various combinations for CopyReferencedAssembliesToWorkspace / PreloadReferencedAssemblies / etc but they don't seem to help. Reducing the number of processing threads down to 1 on the grid node does not help either.

The only discernable pattern is that it's roughly the same subset of tests (~400/6000) every time, but I cannot see what could cause it from the code in these tests compared to other tests in the same project.

I'm not using any NUnit3 specific functionality - the test code in question did not change, unless there some setting in NCrunch itself around NUnit3 (I did not find any)?
Remco
#4 Posted : Wednesday, March 23, 2016 11:44:10 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
Thanks for the extra details. Would you be able to try working with the grid node disconnected for an hour to confirm 100% that it is the grid processing that is causing the problem? Also, can you confirm that you've also updated the grid node to 2.20?

It would be great if you could submit a bug report straight after you've had this happen to you. Perhaps the log file can tell us something more about why this is failing.

I don't think this is related to concurrency or parallel execution. More likely its a test identification issue of some kind. Is there anything different or interesting about the tests that seem to be showing the problem? Are these tests using NUnit theories, TestCases or TestCaseSource?
KGreene
#5 Posted : Wednesday, March 23, 2016 12:38:23 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 3/23/2016(UTC)
Posts: 4
Location: United Kingdom

Was thanked: 1 time(s) in 1 post(s)
I've been running disconnected from the grid node using 6 threads locally for around two hours now, with no spurious failures - I'll continue doing so for a while to try to confirm it's a grid-specific issue.

Yes, updated grid node to 2.20; I also tried isolating to one grid server and restarting it in case there was some environmental issue causing it, but after restart it is still showing the same issues.

I'll re-enable grid processing later today and submit a bug report with it.

There does not appear to be any common pattern to the failing tests - they are a mixture of Test, TestCase and TestCaseSource; some in classes with [SetUp], some with [OneTimeSetUp], and some without any initialisation.
Remco
#6 Posted : Wednesday, March 23, 2016 9:20:36 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
Thanks, that does narrow it down a bit. One unfortunate problem with having the issue appearing on the remote node is that the local bug report log file likely won't be able to tell us much of use. I think our best chance here would be to try and extract a log from the grid node when it fails.

Would you be able to turn on logging (at detailed level) in the remote node's configuration? If you then work with the node for a little while to make the problem appear, it should be possible to find the portion of the log containing the failure then ZIP this up and submit it through the contact form on this site. I hope it's something as simple as the test environment exploding with a well descriptive exception..
KGreene
#7 Posted : Friday, May 13, 2016 1:29:03 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 3/23/2016(UTC)
Posts: 4
Location: United Kingdom

Was thanked: 1 time(s) in 1 post(s)
Apologies for the delay in replying back here - it would appear that installing .Net 4.6 and the visual studio 2015 build tools on the ncrunch grid nodes has fixed the problem!

Will continue to monitor and will update if this changes, but for now it's looking good.
1 user thanked KGreene for this useful post.
Remco on 5/13/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.049 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download