NUnit test suite passes, but runner fails when exiting failing the build

jumpinjackie's Avatar

jumpinjackie

25 Aug, 2014 03:50 AM

Hi,

I just set up a new project on AppVeyor, the NUnit test suite passes but the runner crashes on exit causing the whole build to be marked as failed.

Here's a sample of the output:

258NUnit-Console version 2.6.3.13283
259Copyright (C) 2002-2012 Charlie Poole.
260Copyright (C) 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov.
261Copyright (C) 2000-2002 Philip Craig.
262All Rights Reserved.
263
264Runtime Environment -
265 OS Version: Microsoft Windows NT 6.2.9200.0
266 CLR Version: 2.0.50727.8000 ( Net 3.5 )
267
268ProcessModel: Default DomainUsage: Single
269Execution Runtime: net-3.5
270.............................................Unhandled Exception:
271System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:1041
272
273Server stack trace:
274 at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
275 at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
276 at System.Runtime.Remoting.Channels.RemoteConnection.CreateNewSocket(EndPoint ipEndPoint)
277 at System.Runtime.Remoting.Channels.RemoteConnection.CreateNewSocket()
278 at System.Runtime.Remoting.Channels.RemoteConnection.GetSocket()
279 at System.Runtime.Remoting.Channels.SocketCache.GetSocket(String machinePortAndSid, Boolean openNew)
280 at System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink.SendRequestWithRetry(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream)
281 at System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink.ProcessMessage(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream, ITransportHeaders& responseHeaders, Stream& responseStream)
282 at System.Runtime.Remoting.Channels.BinaryClientFormatterSink.SyncProcessMessage(IMessage msg)
283
284Exception rethrown at [0]:
285 at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
286 at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
287 at System.IDisposable.Dispose()
288 at NUnit.Core.ProxyTestRunner.Dispose()
289 at NUnit.Util.ProcessRunner.Dispose()
290 at NUnit.ConsoleRunner.ConsoleUi.Execute(ConsoleOptions options)
291 at NUnit.ConsoleRunner.Runner.Main(String[] args)
292Command exited with code -100

Full build output here: https://ci.appveyor.com/project/jumpinjackie/fdo-swig/build/job/ve20ew74a5t3gl7i

Any idea what's going on here? My test suite does not use or make any socket connections.

- Jackie

  1. Support Staff 1 Posted by Feodor Fitsner on 25 Aug, 2014 03:57 AM

    Feodor Fitsner's Avatar

    Is it every time and in the same place (same test)?

    -Feodor

  2. 2 Posted by jumpinjackie on 25 Aug, 2014 04:16 AM

    jumpinjackie's Avatar

    Yes, it's happening every build since I got the tests set up. The port number in question may change (some failed builds the port number was 1040 instead of 1041), but the crash and stack trace is consistent.

    - Jackie

  3. 3 Posted by kristoffer on 25 Aug, 2014 03:30 PM

    kristoffer's Avatar

    Same here for Xunit but never finishes, all tests are reported as green and then nothing more happens (waited 13min for a project that usually takes 2min before hitting cancel)

    EDIT : FINISHED with error that can be related, see post below

  4. 4 Posted by kristoffer on 25 Aug, 2014 03:49 PM

    kristoffer's Avatar
    27Test assembly: C:\projects\omnioc\OmnIOC.Tests\bin\Debug\OmnIoc.Tests.dll
    28 
    29.System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Net.WebException: The operation has timed out
    30 
    31Server stack trace: 
    32   at System.Net.WebClient.UploadDataInternal(Uri address, String method, Byte[] data, WebRequest& request)
    33   at System.Net.WebClient.UploadData(Uri address, String method, Byte[] data)
    34   at System.Net.WebClient.UploadData(String address, String method, Byte[] data)
    35   at Appveyor.BuildAgent.Api.BuildServices.UpdateTest(String testName, String testFramework, String fileName, TestOutcome outcome, Nullable`1 durationMilliseconds, String errorMessage, String errorStackTrace, String stdOut, String stdErr) in c:\Projects\Appveyor\appveyor\Appveyor.BuildAgent.Api\BuildServices.cs:line 107
    36   at Xunit.ConsoleClient.AppveyorRunnerCallback.TestPassed(TestMethod method, TestPassedResult result)
    37   at Xunit.ConsoleClient.RunnerCallback.TestFinished(TestMethod method)
    38   at Xunit.TestAssembly.TestMethodRunnerCallbackWrapper.TestFinished(TestMethod testMethod)
    39   at Xunit.TestClassCallbackDispatcher.TestFinished(String name, String type, String method)
    40   at Xunit.XmlLoggerAdapter.LogTestNode(XmlNode testNode, IRunnerLogger logger)
    41   at Xunit.XmlLoggerAdapter.LogNode(XmlNode node, IRunnerLogger logger)
    42   at Xunit.TestClass.<>c__DisplayClassa.<RunTests>b__8(XmlNode node)
    43   at Xunit.ExecutorWrapper.XmlNodeCallbackHandlerWithICallbackEventHandler.RaiseCallbackEvent(String result)
    44   at Xunit.{Dynamic}.XmlNodeCallbackEventHandler.ICallbackEventHandler.RaiseCallbackEvent(String eventArgument)
    45   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
    46   at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)
    47 
    48Exception rethrown at [0]: 
    49   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
    50   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
    51   at System.Web.UI.ICallbackEventHandler.RaiseCallbackEvent(String eventArgument)
    52   --- End of inner exception stack trace ---
    53   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
    54   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
    55   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
    56   at Xunit.Sdk.ExecutorCallback.CallbackEventHandlerCallback.Notify(String value)
    57   at Xunit.Sdk.Executor.OnTestResult(ITestResult result, ExecutorCallback callback)
    58   at Xunit.Sdk.Executor.RunTests.<>c__DisplayClass12.<.ctor>b__11(ITestResult result)
    59   at Xunit.Sdk.TestClassCommandRunner.Execute(ITestClassCommand testClassCommand, List`1 methods, Predicate`1 startCallback, Predicate`1 resultCallback)
    60   at Xunit.Sdk.Executor.RunTests.<>c__DisplayClass12.<.ctor>b__f()
    61   at Xunit.Sdk.Executor.ThreadRunner(Object threadStart)
    62   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
    63   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preser
    
  5. Support Staff 5 Posted by Feodor Fitsner on 26 Aug, 2014 03:23 AM

    Feodor Fitsner's Avatar

    There were some issues with one of AV web servers. Everything is fixed now. To exclude the chance these problems are related are you able to reproduce your issue now?

  6. 6 Posted by jumpinjackie on 26 Aug, 2014 03:41 AM

    jumpinjackie's Avatar

    Hmmm, my build now passes when Platform is x64 but still fails (nunit-console-x86 crash on exit) when Platform is x86

    https://ci.appveyor.com/project/jumpinjackie/fdo-swig/build/0.1.0.19

  7. Support Staff 7 Posted by Feodor Fitsner on 26 Aug, 2014 03:53 AM

    Feodor Fitsner's Avatar

    That's something with NUnit runner. Notice that there are 45 dots (https://ci.appveyor.com/project/jumpinjackie/fdo-swig/build/0.1.0.1...) meaning all 45 tests passed. The error comes from "finalizing" code of NUnit runner. Googling gives some similar cases. When running tests against x86 assembly the runner is different: nunit-console-x86.exe

  8. Support Staff 8 Posted by Feodor Fitsner on 26 Aug, 2014 03:57 AM

    Feodor Fitsner's Avatar

    Might be a problem with TearDown of some test...

  9. 9 Posted by jumpinjackie on 30 Aug, 2014 12:29 PM

    jumpinjackie's Avatar

    I ported my test suite over to xunit and disposed some objects in my test code and my builds are passing now

  10. Support Staff 10 Posted by Feodor Fitsner on 30 Aug, 2014 03:16 PM

    Feodor Fitsner's Avatar

    That's interesting. Thanks for the update.

    While working with a different unit test frameworks I got a feeling that xUnit is the most actual one.

  11. Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 01:47 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac