Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Console runner dies when test agent dies #916

Closed
MaceWindu opened this issue Oct 21, 2015 · 4 comments
Closed

Console runner dies when test agent dies #916

MaceWindu opened this issue Oct 21, 2015 · 4 comments

Comments

@MaceWindu
Copy link

When test runner dies, console runner dies with following exception leaving other runners running abandoned (--process=Multiple).

System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host

  Server stack trace:
     at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
     at System.Runtime.Remoting.Channels.SocketStream.Read(Byte[] buffer, Int32 offset, Int32 size)
     at System.Runtime.Remoting.Channels.SocketHandler.ReadFromSocket(Byte[] buffer, Int32 offset, Int32 count)
     at System.Runtime.Remoting.Channels.SocketHandler.BufferMoreData()
     at System.Runtime.Remoting.Channels.SocketHandler.Read(Byte[] buffer, Int32 offset, Int32 count)
     at System.Runtime.Remoting.Channels.SocketHandler.ReadAndMatchFourBytes(Byte[] buffer)
     at System.Runtime.Remoting.Channels.Tcp.TcpSocketHandler.ReadAndMatchPreamble()
     at System.Runtime.Remoting.Channels.Tcp.TcpSocketHandler.ReadVersionAndOperation(UInt16& operation)
     at System.Runtime.Remoting.Channels.Tcp.TcpClientSocketHandler.ReadHeaders()
     at System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink.ProcessMessage(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream, ITransportHeaders& responseHeaders, Stream& responseStre
  am)
     at System.Runtime.Remoting.Channels.BinaryClientFormatterSink.SyncProcessMessage(IMessage msg)

  Exception rethrown at [0]:
     at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
     at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
     at NUnit.Engine.ITestAgent.Stop()
     at NUnit.Engine.Runners.ProcessRunner.Dispose(Boolean disposing)
     at NUnit.Engine.Runners.AbstractTestRunner.Dispose()
     at NUnit.Engine.Runners.AggregatingTestRunner.Dispose(Boolean disposing)
     at NUnit.Engine.Runners.AbstractTestRunner.Dispose()
     at NUnit.Engine.Runners.MasterTestRunner.Dispose(Boolean disposing)
     at NUnit.Engine.Runners.AbstractTestRunner.Dispose()
     at NUnit.ConsoleRunner.ConsoleRunner.RunTests(TestPackage package, TestFilter filter)
     at NUnit.ConsoleRunner.Program.Main(String[] args)

Currently I'm investigating why agent dies and will report it as a separate issue.

@CharliePoole
Copy link
Contributor

Good point. It mattered less when we only ran one agent at a time. With parallel agents, we should simply report the error and continue.

@rprouse
Copy link
Member

rprouse commented Oct 27, 2015

@MaceWindu, what version of NUnit are you using? I created a test project using the example code you provided in #917 and I get the proper TypeInitializationException for the test and both assemblies run with the current 3.0 codebase. I am thinking it might be fixed.

I am running with this command line, CrashingNunitTest.dll contains your code from #917. Do you see anything I am doing differently reproducing?

.\bin\Debug\nunit-console.exe --process=Multiple .\bin\Debug\net-4.5\nunit.framework.tests.dll C:\src\spikes\CrashingNunitTest\bin\Debug\CrashingNunitTest.dll

All of the tests run and I get one error,

1) SetUp Error : Test
System.TypeInitializationException : The type initializer for 'Test' threw an exception.
  ----> NUnit.Framework.AssertionException :   Expected: not null
  But was:  null
   at Test..ctor()
--AssertionException
   at NUnit.Framework.Assert.That[TActual](TActual actual, IResolveConstraint expression, String message, Object[] args) in C:\src\github\nunit\src\NUnitFramework\framework\Assert.That.cs:line 186
   at NUnit.Framework.Assert.IsNotNull(Object anObject) in C:\src\github\nunit\src\NUnitFramework\framework\Assert.Conditions.cs:line 262
   at Test.get_FailSource() in c:\src\spikes\CrashingNunitTest\CrashingNunitTest\Test.cs:line 11
   at Test..cctor() in c:\src\spikes\CrashingNunitTest\CrashingNunitTest\Test.cs:line 5

@rprouse
Copy link
Member

rprouse commented Oct 27, 2015

Specifically, I think #917 may be fixed, I will just need to find another way to cause the agent to crash 😄

CharliePoole added a commit that referenced this issue Oct 28, 2015
ChrisMaddock pushed a commit to ChrisMaddock/nunit that referenced this issue Aug 10, 2016
@jnm2
Copy link
Contributor

jnm2 commented May 29, 2017

We believe this was fixed by nunit/nunit-console#223 which will be released as part of NUnit.Console 3.7. If you'd like to confirm sooner that the issue is fixed, please try 3.7.0-dev-03641 from the https://ci.appveyor.com/nuget/nunit-console NuGet feed.

If it turns out that this does not fix your issue, please open a new issue at https://github.com/nunit/nunit-console/issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants