question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Getting exit code -5 with NUnit console runner 3.8, using NUnit 3.10

See original GitHub issue

The console runner exits with exit code -5. However, when I lookup the source here, this is commented out. There is no additional information with the exit (no errors, apart from the usual from failing tests).

My project uses 3.10 most recent NUnit framework, the console runner is 3.8, it is run from within TeamCity. What does this exit code mean and if it is valid, is it possible to give some more information when this situation occurs?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:18 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
CharliePoolecommented, May 13, 2018

Either approach should work.

0reactions
abelbraaksmacommented, May 18, 2018

Just a heads-up, mystery solved for the exit code -5 (and on some other versions, exit code -100).

In case you’re curious (and thanks for all your patience and help!):

There appeared to be a statically inlined method that caused a stack-overflow. It is understandable that NUnit cannot deal with StackOverflowException, though I know there are some (complex) ways to track them (one program that does this correctly is NCrunch). The hard part in finding the exception was that the test causing it was never in the log and the moment it happened changed between runs.

The exception in other test engines never occurred because it was only triggered in a Debug.Assert that only fired in very specific circumstances, that were true on the build server when run from TeamCity and that were triggered by daylight savings time switching, but not true when run from the commandline on the same server (ouch, I know, that dependency should never have been there).

Of course, it would still be very nice to see a stacktrace and perhaps there’s something that can be done by catching a first-chance exception or something, I don’t know. Either way, I am not too surprised now that I know the underlying reason.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Where can I find the meaning of NUnit console exit codes?
It seems that -5 is gone in 3.10. Perhaps the assembly Unload problem no longer occurs.
Read more >
NUnit Step exited with code -5
Step 3/4: UnitTest (NUnit) (18s). [10:45:49][Step 3/4] Starting: D:\TeamCity\buildAgent\tools\NUnit.Console.3.8.0\nunit3-console.exe ...
Read more >
Console and Engine Release Notes
This is the first release of the NUnit Console Runner, nunit3-console.exe , which allows running of both .NET Framework and .NET Core tests,...
Read more >
nunit-console return codes
Until recently, it was pretty solid, but then we added 10,000 test cases (using generator functions) and now it regularly fails with exit...
Read more >
packages - NUnit.3.12.0 - CHANGES.md
This release fixes two critical regressions in the 3.8 release. The first caused the console runner to crash if you are using test ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found