mono / mono

Mono open source ECMA CLI, C# and .NET implementation.
https://www.mono-project.com
Other
11.13k stars 3.82k forks source link

System.Runtime.Remoting.RemotingException : Tcp transport error. #16434

Open vegesnacreativeworks opened 5 years ago

vegesnacreativeworks commented 5 years ago

I am trying to run the Nunit3 test using Nunit 3.10 Console runner. i am getting below error.

1) Error : 
System.Runtime.Remoting.RemotingException : Tcp transport error.
  ----> System.Runtime.Remoting.RemotingException : Connection closed
--RemotingException
Tcp transport error.

Server stack trace: 
  at System.Runtime.Remoting.Channels.Tcp.TcpMessageIO.ReceiveMessageStatus (System.IO.Stream networkStream, System.Byte[] buffer) [0x00017] in <a625ce6df6374e4a98cb2931a6b5bc3b>:0 
  at System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink.ProcessMessage (System.Runtime.Remoting.Messaging.IMessage msg, System.Runtime.Remoting.Channels.ITransportHeaders requestHeaders, System.IO.Stream requestStream, System.Runtime.Remoting.Channels.ITransportHeaders& responseHeaders, System.IO.Stream& responseStream) [0x0005e] in <a625ce6df6374e4a98cb2931a6b5bc3b>:0 
  at System.Runtime.Remoting.Channels.BinaryClientFormatterSink.SyncProcessMessage (System.Runtime.Remoting.Messaging.IMessage msg) [0x00066] in <a625ce6df6374e4a98cb2931a6b5bc3b>:0 

Exception rethrown at [0]: 
  at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke (System.Runtime.Remoting.Proxies.RealProxy rp, System.Runtime.Remoting.Messaging.IMessage msg, System.Exception& exc, System.Object[]& out_args) [0x0014d] in <7a62ef3b49f14d16b21221b9b5a4792c>:0 
  at (wrapper managed-to-native) System.Object.__icall_wrapper_mono_remoting_wrapper(intptr,intptr)
  at (wrapper remoting-invoke) NUnit.Engine.Agents.RemoteTestAgent.Run(NUnit.Engine.ITestEventListener,NUnit.Engine.TestFilter)
  at NUnit.Engine.Runners.ProcessRunner.RunTests (NUnit.Engine.ITestEventListener listener, NUnit.Engine.TestFilter filter) [0x00025] in <d5dabe0b10664f5d8da90fb102a841f8>:0 
--
RemotingException
Connection closed
  at System.Runtime.Remoting.Channels.Tcp.TcpMessageIO.StreamRead (System.IO.Stream networkStream, System.Byte[] buffer, System.Int32 count) [0x00011] in <a625ce6df6374e4a98cb2931a6b5bc3b>:0 
  at System.Runtime.Remoting.Channels.Tcp.TcpMessageIO.ReceiveMessageStatus (System.IO.Stream networkStream, System.Byte[] buffer) [0x00000] in <a625ce6df6374e4a98cb2931a6b5bc3b>:0 

i am using below sample command to run my unit tests /mono /nunit-console-runner.3.10.0/tools/nunit3-console.exe /pathtodl/test.dll --trace=Verbose -test=Namespace.TestSmaple -output=outputfilepath -result=pathtoxml

my Csproject is build using Nunit 3.10.0 and XmarinUItest 3.0.3 version.

Pacakge information

<package id="NUnit" version="3.10.0" targetFramework="net461" />
  <package id="Xamarin.UITest" version="3.0.2" targetFramework="net461" />

Internal StackTrace

15:37:17.887 Error [ 1] ProcessRunner: Failed to run remote tests Tcp transport error.
15:37:17.897 Info  [ 1] ProcessRunner: Unloading 
15:37:18.932 Warning [ 1] ProcessRunner: Failed to unload the remote runner. Tcp transport error.
15:37:18.932 Error [ 1] ProcessRunner: System.Runtime.Remoting.RemotingException : Tcp transport error.
  ----> System.IO.IOException : Unable to read data from the transport connection: Connection reset by peer.
  ----> System.Net.Sockets.SocketException : Connection reset by peer
15:37:18.932 Error [ 1] ProcessRunner: --RemotingException
Tcp transport error.

Target Framework in the Csproject file is <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>

Additional Details:

Runtime Environment
   OS Version: MacOSX 17.7.0.0 
  CLR Version: 4.0.30319.42000

Could you pls help me whether Nunit3 console runner works for Xamarin UI tests(3.0.3) version.

gertjvr commented 3 years ago

I have the exact same issue with nunit3-console 3.12.0 and Xamarin UITests 3.0.19 and Microsoft Hosted agent macOS 10.15

Errors, Failures and Warnings

1) Error : 
Tcp transport error.

Server stack trace: 
  at System.Runtime.Remoting.Channels.Tcp.TcpMessageIO.ReceiveMessageStatus (System.IO.Stream networkStream, System.Byte[] buffer) [0x0000c] in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/external/bockbuild/builds/mono-x64/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels.Tcp/TcpMessageIO.cs:56 
  at System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink.ProcessMessage (System.Runtime.Remoting.Messaging.IMessage msg, System.Runtime.Remoting.Channels.ITransportHeaders requestHeaders, System.IO.Stream requestStream, System.Runtime.Remoting.Channels.ITransportHeaders& responseHeaders, System.IO.Stream& responseStream) [0x00052] in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/external/bockbuild/builds/mono-x64/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels.Tcp/TcpClientTransportSink.cs:188 
  at System.Runtime.Remoting.Channels.BinaryClientFormatterSink.SyncProcessMessage (System.Runtime.Remoting.Messaging.IMessage msg) [0x00066] in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/external/bockbuild/builds/mono-x64/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/BinaryClientFormatterSink.cs:157 

Exception rethrown at [0]: 
  at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke (System.Runtime.Remoting.Proxies.RealProxy rp, System.Runtime.Remoting.Messaging.IMessage msg, System.Exception& exc, System.Object[]& out_args) [0x001aa] in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/external/bockbuild/builds/mono-x64/mcs/class/corlib/System.Runtime.Remoting.Proxies/RealProxy.cs:326 
  at (wrapper managed-to-native) System.Object.__icall_wrapper_mono_remoting_wrapper(intptr,intptr)
  at (wrapper remoting-invoke) NUnit.Engine.Agents.RemoteTestAgent.Run(NUnit.Engine.ITestEventListener,NUnit.Engine.TestFilter)
  at NUnit.Engine.Runners.ProcessRunner.RunTests (NUnit.Engine.ITestEventListener listener, NUnit.Engine.TestFilter filter) [0x00025] in <7b0953727751470ab10f0e0b547b85ae>:0 

Test Run Summary
  Overall result: Failed
  Test Count: 0, Passed: 0, Failed: 0, Warnings: 0, Inconclusive: 0, Skipped: 0
  Start time: 2021-06-17 05:00:31Z
    End time: 2021-06-17 05:03:38Z
    Duration: 186.588 seconds

Results (nunit3) saved as /Users/runner/work/1/a/uitests_result.xml

Tcp transport error.
Failed to stop the remote agent. Connection refused
##[error]Bash exited with code '156'.
Finishing: Run Android Emulator UI Tests