You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a test which fails with buggy exception (ex.Message throws exception). When nunit tries to get exception details for test outcome messages, it leads to test runner crash, which results in test run stop (still visual studio test runner shows progress animation, but no test executed anymore).
Stack trace of original exception:
atSystem.Collections.ArrayList.get_Item(Int32index)
at Sybase.Data.AseClient.AseErrorCollection.get_Message()
at Sybase.Data.AseClient.AseException.get_Message()
at NUnit.Framework.Internal.ExceptionHelper.GetExceptionMessage(Exceptionex)
at NUnit.Framework.Internal.ExceptionHelper.BuildMessage(Exceptionexception,BooleanexcludeExceptionNames)
at NUnit.Framework.Internal.TestResult.ExceptionResult..ctor(Exceptionex,FailureSitesite)
at NUnit.Framework.Internal.TestResult.RecordException(Exceptionex)
at NUnit.Framework.Internal.Execution.SimpleWorkItem.PerformWork()
at NUnit.Framework.Internal.Execution.WorkItem.RunOnCurrentThread()
at NUnit.Framework.Internal.Execution.WorkItem.Execute()
at NUnit.Framework.Internal.Execution.SimpleWorkItemDispatcher.Dispatch(WorkItemwork)
at NUnit.Framework.Internal.Execution.CompositeWorkItem.RunChildren()
at NUnit.Framework.Internal.Execution.CompositeWorkItem.PerformWork()
at NUnit.Framework.Internal.Execution.WorkItem.RunOnCurrentThread()
at NUnit.Framework.Internal.Execution.WorkItem.Execute()
at NUnit.Framework.Internal.Execution.SimpleWorkItemDispatcher.Dispatch(WorkItemwork)
at NUnit.Framework.Internal.Execution.CompositeWorkItem.RunChildren()
at NUnit.Framework.Internal.Execution.CompositeWorkItem.PerformWork()
at NUnit.Framework.Internal.Execution.WorkItem.RunOnCurrentThread()
at NUnit.Framework.Internal.Execution.WorkItem.Execute()
at NUnit.Framework.Internal.Execution.SimpleWorkItemDispatcher.Dispatch(WorkItemwork)
at NUnit.Framework.Internal.Execution.CompositeWorkItem.RunChildren()
at NUnit.Framework.Internal.Execution.CompositeWorkItem.PerformWork()
at NUnit.Framework.Internal.Execution.WorkItem.RunOnCurrentThread()
at NUnit.Framework.Internal.Execution.WorkItem.Execute()
at NUnit.Framework.Internal.Execution.SimpleWorkItemDispatcher.Dispatch(WorkItemwork)
at NUnit.Framework.Internal.Execution.CompositeWorkItem.RunChildren()
at NUnit.Framework.Internal.Execution.CompositeWorkItem.PerformWork()
at NUnit.Framework.Internal.Execution.WorkItem.RunOnCurrentThread()
at NUnit.Framework.Internal.Execution.WorkItem.Execute()
at NUnit.Framework.Internal.Execution.SimpleWorkItemDispatcher.Dispatch(WorkItemwork)
at NUnit.Framework.Internal.Execution.CompositeWorkItem.RunChildren()
at NUnit.Framework.Internal.Execution.CompositeWorkItem.PerformWork()
at NUnit.Framework.Internal.Execution.WorkItem.RunOnCurrentThread()
at NUnit.Framework.Internal.Execution.WorkItem.Execute()
at NUnit.Framework.Internal.Execution.SimpleWorkItemDispatcher.Dispatch(WorkItemwork)
at NUnit.Framework.Internal.Execution.CompositeWorkItem.RunChildren()
at NUnit.Framework.Internal.Execution.CompositeWorkItem.PerformWork()
at NUnit.Framework.Internal.Execution.WorkItem.RunOnCurrentThread()
at NUnit.Framework.Internal.Execution.WorkItem.Execute()
at NUnit.Framework.Internal.Execution.SimpleWorkItemDispatcher.RunnerThreadProc()
at System.Threading.ThreadHelper.ThreadStart_Context(Objectstate)
at System.Threading.ExecutionContext.RunInternal(ExecutionContextexecutionContext,ContextCallbackcallback,Objectstate,BooleanpreserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContextexecutionContext,ContextCallbackcallback,Objectstate,BooleanpreserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContextexecutionContext,ContextCallbackcallback,Objectstate)
at System.Threading.ThreadHelper.ThreadStart()
Note that we cannot fix this exception class, because it is a third party library, which hardly be fixed by it's vendor.
Nunit version: 3.12.0 (used through nuget)
The text was updated successfully, but these errors were encountered:
So the Message property of the custom exception is apparently executing code? Wow!
So, for anything but a testing framework, I'd say "Too bad for them." But NUnit is supposed to work with bad code (whether yours or the vendors) and help you fix it, so I agree this should be handled. OTOH, I do not think we should go any further in the exception chain of the Message than just reporting that an exception was thrown. Others?
This is almost exactly the problem that I believe is causing the hang at #3295. In that case, .NET Framework has a bug (https://github.com/dotnet/coreclr/issues/19698) where calling Exception.StackTrace (or indirectly e.g. Exception.ToString()) throws AccessViolationException.
I was planning to work on that today, so I'll roll this into it.
We have a test which fails with buggy exception (ex.Message throws exception). When nunit tries to get exception details for test outcome messages, it leads to test runner crash, which results in test run stop (still visual studio test runner shows progress animation, but no test executed anymore).
Stack trace of original exception:
Note that we cannot fix this exception class, because it is a third party library, which hardly be fixed by it's vendor.
Nunit version: 3.12.0 (used through nuget)
The text was updated successfully, but these errors were encountered: