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.

SocketException thrown during console run

See original GitHub issue

@HaomingFu commented on Fri Jul 07 2017

I’m using NUnit3.5 console runner. I use nunit console to run my unit tests. There is no deterministic repro but it fails very often with error code -100.

nunit3-console.exe UnitTest.Client.dll --where "cat==MyTests" --output=RBSUnitTest_General_OutputFile.txt --result=RBSUnitTest_General_ResultFile.xml

I see this in the nunit console cmd output:

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.Read(Byte[] buffer, Int32 offset, Int32 count)
   at System.Runtime.Remoting.Channels.Tcp.TcpFixedLengthReadingStream.Read(Byte[] buffer, Int32 offset, Int32 count)
   at System.IO.BinaryReader.ReadBytes(Int32 count)
   at System.Runtime.Serialization.Formatters.Binary.SerializationHeaderRecord.Read(__BinaryParser input)
   at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadSerializationHeaderRecord()
   at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run()
   at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
   at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
   at System.Runtime.Remoting.Channels.CoreChannel.DeserializeBinaryResponseMessage(Stream inputStream, IMethodCallMessage reqMsg, Boolean bStrictBinding)
   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.MasterTestRunner.Dispose(Boolean disposing)
   at NUnit.Engine.Runners.MasterTestRunner.Dispose()
   at NUnit.ConsoleRunner.ConsoleRunner.RunTests(TestPackage package, TestFilter filter)
   at NUnit.ConsoleRunner.Program.Main(String[] args)

Any help would be appreciated.


@ChrisMaddock commented on Fri Jul 07 2017

I’d expect this is the same issue as this, which will be fixed in NUnit Console 3.7.

https://github.com/nunit/nunit-console/issues/225

Try the console from the latest build of master at the link below - and see if that solves the problems you’re seeing? https://ci.appveyor.com/project/CharliePoole/nunit-console/build/3.7.0-dev-03691/artifacts


@ChrisMaddock commented on Fri Jul 07 2017

I’m also going to move this issue over to the NUnit Console repo.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:105 (33 by maintainers)

github_iconTop GitHub Comments

2reactions
ChrisMaddockcommented, Aug 18, 2017

Sounds sensible to me. All for removing unnecessary complexity. 🙂

1reaction
ChrisMaddockcommented, Feb 15, 2018

All,

We believe this issue will have been fixed by @BlythMeister’s temporary fix in #370.

Until the next console release, please try the master build, version 3.9.0-dev-03932 or later. You can find this on out MyGet Feed.


If you still experience this issue with the above build of master…

  1. Run your tests with the --inprocess flag - see if this exposes a more useful exception or error message.

  2. Add the --trace=Debug flag to your command line. When you next see the exception, examine the logs for any clues.

Please then open a new issue. The SocketException is often caused by an nunit-agent crash, which can occur in a number of different scenarios. We believe many of these have been fixed in NUnit.Console 3.8, and the fix in #372 - however, they may still be edge cases we have yet to tackle. Please report these if you come across any!

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - How to handle Socket Exception
SocketException and deselect Thrown. ... Of course, you will not have this issue when you run your ... SocketException ex) { Console.
Read more >
System.Net.Sockets.SocketException
SocketException is thrown when an error occurs within a socket , such as a failure to ... otherwise uses standard <see cref="Console.
Read more >
Remote Debugging Testing: System.Net.Sockets. ...
When I try to debug a test using ubuntu in wsl a "connection timed out" exception is thrown and the test are not...
Read more >
Console and Engine Release Notes
#1178 Running tests with nunit3-console version 3.15.0 generates empty log ... 253 Master Chocolatey issue; 255 SocketException thrown during console run ...
Read more >
java.net.SocketException in Java with Examples
This SocketException occurs on the server-side when the client closed the ... SimpleServerApp$SimpleServer.run(SimpleServerApp.java:36).
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