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.

Insufficient error handling message in ProcessRunner -> RunTests method

See original GitHub issue

@Fernell commented on Fri Jul 28 2017

log.Error(“Failed to run remote tests {0}”, e.Message); is insufficeint. It lacks details required to diagnose problem. Here is sample of my log:

An exception occurred in the driver while loading tests. Server stack trace: at NUnit.Engine.Runners.DirectTestRunner.LoadDriver(IFrameworkDriver driver, String testFile, TestPackage subPackage) at NUnit.Engine.Runners.DirectTestRunner.LoadPackage() at NUnit.Engine.Runners.TestDomainRunner.LoadPackage() at NUnit.Engine.Runners.DirectTestRunner.EnsurePackageIsLoaded() at NUnit.Engine.Runners.DirectTestRunner.RunTests(ITestEventListener listener, TestFilter filter) at NUnit.Engine.Runners.AbstractTestRunner.Run(ITestEventListener listener, TestFilter filter) at NUnit.Engine.Runners.AggregatingTestRunner.RunTestsSequentially(ITestEventListener listener, TestFilter filter, List`1 results, Boolean disposeRunners) at NUnit.Engine.Runners.AggregatingTestRunner.RunTests(ITestEventListener listener, TestFilter filter) at NUnit.Engine.Runners.AbstractTestRunner.Run(ITestEventListener listener, TestFilter filter) at NUnit.Engine.Agents.RemoteTestAgent.Run(ITestEventListener listener, TestFilter filter) at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs) at System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(RuntimeMethodHandle md, Object[] args, Object server, Object[]& outArgs) at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)

I was unable to recognize error only by this stack trace. I was forced to download nunit3-console binaries and debug it myself. I found out that useful error message was in ex.InnerException which is not returned in error message at all. Please extend error message by adding ex.InnerException message.


@ChrisMaddock commented on Fri Jul 28 2017

This is an nunit-console issue, I’ll move it over to that repository.

@Fernell - we’d appreciate a Pull Request, if you were willing.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
ChrisMaddockcommented, Jul 28, 2017

I think this may be a general issue for some of our console logging.

In the framework, we have ExceptionHelper - which flattens exceptions hierarchy, and (theoretically) ensures everything useful is printed. Having an equivalent in the console would be nice.

https://github.com/nunit/nunit/blob/master/src/NUnitFramework/framework/Internal/ExceptionHelper.cs#L159

0reactions
davidenqcommented, Jan 15, 2018

Hi everyone, I’m not sure if it is the same issue #270 but I’ve found a solution and I’ve published a comment there with an example.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Console and Engine Release Notes
#291 Error running tests from assembly built using VS2017 csproj file format ... 273 Insufficient error handling message in ProcessRunner -> RunTests method...
Read more >
Thoughtful Error Handling
While testing the API I noticed that one of the error messages reflected the data I entered back to the screen.
Read more >
Handling the Error 'The test run has stopped...'
TestComplete includes several settings that control whether the test run should stop once an error message (or a warning) is posted to the...
Read more >
Testing the wording of an Exception message
I feel that testing the literal text of an Exception is bad practice. Never try to interpret the wording of an Exception message....
Read more >
Testing and error handling patterns in Next.js
This article aims to reveal the different ways to run tests and handle errors in a Next.js application through the following sections:.
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