Reputation: 4668
I'm having trouble running my tests with NUnit
in my Jenkins build. Where the tests all succeed when I run them manually (via a Cake
build script) - even directly on the build server -, they fail when run during a build in Jenkins that calls that very same build script.
As output I get the following message:
An error occurred when executing task 'Test'. Error: NUnit3: Unrecognised error (exit code -1073740940).
When running NUnit
with TraceLevel = TraceLevel.Debug
, I get a trace file that looks fine until it simply stops after the same line:
15:49:14.342 Debug [ 6] Dispatcher: Using Direct strategy for <my failing test>
I'm running NUnit
with InProcess
and a single worker.
It's always the same test failing - but only when run in the CI build. I get that it's nearly impossible to diagnose the exact problem from here - what I'm asking is for is if there's any way to get any more information on what exactly is failing?
Upvotes: 1
Views: 347
Reputation: 13736
Based on the error code, this seems to be a heap corruption error (C0000374). For more info see https://blogs.msdn.microsoft.com/calvin_hsia/2015/01/30/heap-corruption-exception-0xc0000374/ for some examples of how such an error is generated.
My guess is that your test is doing something bad and getting away with it in most circumstances but that running under Jenkins may change the environment enough so that it throws the exception.
This is very hard to diagnose. First thing I would want to ascertain is whether any of your test code gets executed at all. The NUnit internal trace appears to indicate that the test was dispatched (enqueued) but not actually dequeued and run. However, we sometimes lose a few events when the runner crashes.
You might try running with --workers=0 to see if the simplified execution code (no queues are used) gets you more information.
Upvotes: 2