Repository navigation
Closed
Description
One test is still unstable. The following test failed on master:
[00:05:13] Passed IsStartedShouldReturnTrue [6 ms]
[00:05:13] Failed ForwardedPortShouldAcceptNewConnections [43 ms]
[00:05:13] Error Message:
[00:05:13] Test method Renci.SshNet.Tests.Classes.ForwardedPortRemoteTest_Start_PortStarted.ForwardedPortShouldAcceptNewConnections threw exception:
[00:05:13] Moq.MockException:
[00:05:13] Expected invocation on the mock once, but was 0 times: p => p.CreateChannelForwardedTcpip(1655820009, 1225918901, 757994702)
[00:05:13]
[00:05:13] Performed invocations:
[00:05:13]
[00:05:13] Mock<ISession:319> (p):
[00:05:13]
[00:05:13] ISession.IsConnected
[00:05:13] ISession.add_ErrorOccured(EventHandler<ExceptionEventArgs>)
[00:05:13] ISession.RegisterMessage("SSH_MSG_REQUEST_FAILURE")
[00:05:13] ISession.RegisterMessage("SSH_MSG_REQUEST_SUCCESS")
[00:05:13] ISession.RegisterMessage("SSH_MSG_CHANNEL_OPEN")
[00:05:13] ISession.add_RequestSuccessReceived(EventHandler<MessageEventArgs<RequestSuccessMessage>>)
[00:05:13] ISession.add_RequestFailureReceived(EventHandler<MessageEventArgs<RequestFailureMessage>>)
[00:05:13] ISession.add_ChannelOpenReceived(EventHandler<MessageEventArgs<ChannelOpenMessage>>)
[00:05:13] ISession.SendMessage(SSH_MSG_GLOBAL_REQUEST)
[00:05:13] ISession.WaitOnHandle(AutoResetEvent)
[00:05:13] ISession.CreateChannelForwardedTcpip(1655820009, 1225918901, 757994702) => Mock<IChannelForwardedTcpip:17>
[00:05:13]
[00:05:13] Mock<IChannelForwardedTcpip:17>:
[00:05:13]
[00:05:13] IChannelForwardedTcpip.add_Exception(EventHandler<ExceptionEventArgs>)
[00:05:13] IChannelForwardedTcpip.Bind(193.168.1.5:25065, ForwardedPortRemote)
[00:05:13] IDisposable.Dispose()
[00:05:13]
[00:05:13] Stack Trace:
[00:05:13] at Moq.Mock.Verify(Mock mock, LambdaExpression expression, Times times, String failMessage) in C:\projects\moq4\src\Moq\Mock.cs:line 316
[00:05:13] at Moq.Mock`1.Verify[TResult](Expression`1 expression, Func`1 times) in C:\projects\moq4\src\Moq\Mock`1.cs:line 840
[00:05:13] at Renci.SshNet.Tests.Classes.ForwardedPortRemoteTest_Start_PortStarted.ForwardedPortShouldAcceptNewConnections() in C:\projects\ssh-net\src\Renci.SshNet.Tests\Classes\ForwardedPortRemoteTest_Start_PortStarted.cs:line 142
[00:05:13] at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
[00:05:13] at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
[00:05:13] Metadata
Metadata
Assignees
Labels
No labels
Activity
WojciechNagorski commentedon Sep 25, 2023
Closed by #1185
WojciechNagorski commentedon Dec 9, 2023
@Rob-Hague This fix does not work. https://ci.appveyor.com/project/drieseng/ssh-net/builds/48717243/job/k3xgumt7lhi8dfbl?fullLog=true
Rob-Hague commentedon Dec 9, 2023
It's actually a different test
Renci.SshNet.Tests.Classes.ForwardedPortRemoteTest_Start_PortStarted.ForwardedPortShouldAcceptNewConnectionsvs
Renci.SshNet.Tests.Classes.ForwardedPortRemoteTest_Start_PortNeverStarted.ForwardedPortShouldAcceptNewConnectionsI think
Thread.Sleepwould work here as well. The problem is that the work inForwardedPortRemoteis dispatched onto another thread:SSH.NET/src/Renci.SshNet/ForwardedPortRemote.cs
Line 258 in 04178d8