NUnit tests stuck in pending
I have a set of NUnit tests in my solution that are not running when I try to execute them through Resharper's unit test sessions window. They are stuck in a Pending state until I eventually kill the test run. This is with Visual Studio Professional 15.9.17 and Resharper 2019.2.3.
After running Resharper with verbose logging, I see the following exceptions in the log file whenever I try to run unit tests through Resharper:
--- EXCEPTION #1/2 [ArgumentNullException]
Message = “Value cannot be null.”
ExceptionPath = Root.InnerException
ClassName = System.ArgumentNullException
HResult = E_POINTER=COR_E_NULLREFERENCE=80004003
Source = System.Core
ParamName = second
StackTraceString = “
at System.Linq.Enumerable.Concat[TSource](IEnumerable`1 first, IEnumerable`1 second)
at JetBrains.ReSharper.UnitTestProvider.nUnit.v30.NUnitTestParametersProvider.GetParameters(IUnitTestRun run)
at JetBrains.ReSharper.UnitTestProvider.nUnit.v30.NUnitServiceProvider.<>c__DisplayClass28_0.<CreateAssemblySetTask>b__0()
at JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitTestAssemblySetTask.get_TestParameters()
at JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitTestAssemblySetTask.SaveXml(XmlElement element)
at JetBrains.ReSharper.TaskRunnerFramework.RemoteTaskPacket.ToXml(XmlElement node)
at JetBrains.ReSharper.UnitTestFramework.UnitTestAgentManager.SendTasks(IEnumerable`1 tasks, IRemoteChannel remoteChannel)
at JetBrains.ReSharper.UnitTestFramework.UnitTestAgentManager.AgentConnected(KeyValuePair`2 args)
at JetBrains.DataFlow.Signal`1.NotifySinks(TValue payload)
”
--- Outer ---
--- EXCEPTION #2/2 [LoggerException]
Message = “
Value cannot be null.
Parameter name: second
”
ExceptionPath = Root
ClassName = JetBrains.Util.LoggerException
Data.ManagedThreadName = <NULL>
InnerException = “Exception #1 at Root.InnerException”
HResult = COR_E_APPLICATION=80131600
StackTraceString = “
at JetBrains.DataFlow.Signal`1.NotifySinks(TValue payload)
at JetBrains.DataFlow.Signal`1.Fire(TValue value, Object cookie)
at JetBrains.DataFlow.Signal`1.Fire(TValue value)
at JetBrains.ReSharper.UnitTestFramework.RemoteChannel.TaskRunnerAgentEventsListener.Accept(RemoteTask remoteTask, IDictionary`2 attributes, XmlReader reader, IRemoteChannel remoteChannel)
at JetBrains.ReSharper.UnitTestFramework.RemoteChannel.TaskRunnerEventsListener.OnTaskPacket(String packetName, IDictionary`2 attributes, RemoteTask remoteTask, XmlReader reader, IRemoteChannel remoteChannel)
at JetBrains.ReSharper.UnitTestFramework.RemoteChannel.TaskRunnerEventsListener.OnPacket(XmlReader reader, IRemoteChannel remoteChannel)
at JetBrains.ReSharper.TaskRunnerFramework.RemoteChannel.ReaderThreadProc()
at JetBrains.ReSharper.TaskRunnerFramework.RemoteChannel.<Start>b__16_0(Object _)
at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
”
It seems like this could be environmental, as this is happening on a new laptop I have recently set up, while the same solution on an older laptop using the same version of Visual Studio and Resharper work just fine.
Can anyone assist me with determining what is causing these exceptions?
Please sign in to leave a comment.
Hello,
Have you tried running tests using VS test runner?
Could you please provide the full log file to us? You can share it privately via 'Submit a request' form.
Thank you.
Angelina Elycheva yes, I am able to execute the unit tests successfully through VS Test Explorer using the NUnit3 Test Adapter.
I have submitted a request with the ReSharper log file attached.
Thanks!
Turns out this was caused by an unrelated runsettings file being used by tests. Removing it allowed the tests to start working correctly.