Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
855d57f
Just removing old target frameworks
WojciechNagorski Apr 11, 2023
d71147a
fix appveyor.yml
WojciechNagorski Apr 11, 2023
3122e18
Check ArgumentOutOfRangeException message
WojciechNagorski Apr 12, 2023
42111ad
Fix next tests
WojciechNagorski Apr 12, 2023
78369dc
Fix tests
WojciechNagorski Apr 12, 2023
abfd063
Fix SendMessageOnSessionShouldBeInvokedThreeTimes
WojciechNagorski Apr 12, 2023
56c0adc
Fix SessionTest_Connected tests
WojciechNagorski Apr 12, 2023
5231b73
Remove NET35
WojciechNagorski Apr 12, 2023
5af2256
Update AsyncSocketListener.cs
WojciechNagorski Apr 12, 2023
521b262
Update AsyncSocketListener.cs
WojciechNagorski Apr 12, 2023
1ef2fb4
Try to fix next random failed test
WojciechNagorski Apr 12, 2023
4abdf5d
Next try
WojciechNagorski Apr 12, 2023
0336a25
Add ObjectDisposedException again
WojciechNagorski Apr 12, 2023
0cc541f
improve tests for NETFRAMEWORK
WojciechNagorski Apr 12, 2023
b08eb41
catch ObjectDisposedException exceptions from SignalBytesReceived
WojciechNagorski Apr 12, 2023
1275707
SocketException (10058)
WojciechNagorski Apr 12, 2023
c4fe1cd
Try to fix test for .NET 7
WojciechNagorski Apr 13, 2023
e803d2b
Add blame
WojciechNagorski Apr 13, 2023
f2e15e2
Add more logs
WojciechNagorski Apr 13, 2023
419cc2a
ConnectionDisconnected
WojciechNagorski Apr 13, 2023
cecb0dd
Use Stopwatch
WojciechNagorski Apr 14, 2023
a8d0533
Show the value in CI/CD
WojciechNagorski Apr 14, 2023
7b2b39b
Update CountdownEventTest.cs
WojciechNagorski Apr 14, 2023
a9f5c1d
Update CountdownEventTest.cs
WojciechNagorski Apr 14, 2023
a6b8c7d
Add AfterAct
WojciechNagorski Apr 14, 2023
8c91779
Update CountdownEventTest.cs
WojciechNagorski Apr 14, 2023
79123fb
last fix?
WojciechNagorski Apr 14, 2023
899a8f8
Update ProtocolVersionExchangeTest_ServerResponseContainsNullCharacte…
WojciechNagorski Apr 14, 2023
bb0b78f
Fix @zybexXL review
WojciechNagorski Apr 14, 2023
5980570
Self review
WojciechNagorski Apr 17, 2023
fc277da
remove the unnecessary using statement
WojciechNagorski Apr 17, 2023
2242e1c
revert
WojciechNagorski Apr 17, 2023
8a5655f
Try
WojciechNagorski Apr 17, 2023
dba67ff
Revert "Try"
WojciechNagorski Apr 17, 2023
db06b60
Revert "revert"
WojciechNagorski Apr 17, 2023
8201be4
Revert "Self review"
WojciechNagorski Apr 17, 2023
3a4b62f
Fix review part 1
WojciechNagorski Apr 21, 2023
984c5c3
Undo accidental changes
WojciechNagorski Apr 21, 2023
af4eb4c
Update readme
WojciechNagorski Apr 24, 2023
7126f92
Use .NET 4.6.2
WojciechNagorski Apr 24, 2023
89079bd
Fix build scripts
WojciechNagorski Apr 24, 2023
35b42d6
Remove AfterAct
WojciechNagorski May 4, 2023
5e61359
Slow down .NET 6 tests
WojciechNagorski May 5, 2023
b23eda7
Fix review part 2
WojciechNagorski May 6, 2023
54a0509
Fix parameter order
WojciechNagorski May 6, 2023
2a5612b
Fix formatting
WojciechNagorski May 6, 2023
3d2ac9e
Remove paramName from MessageEquals
WojciechNagorski May 6, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix SessionTest_Connected tests
  • Loading branch information
WojciechNagorski committed Apr 12, 2023
commit 56c0adc01f60b96b64c3e4df53e3b046990a9e79
40 changes: 28 additions & 12 deletions src/Renci.SshNet.Tests/Common/AsyncSocketListener.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,27 +127,43 @@ private void AcceptCallback(IAsyncResult ar)
// Get the socket that handles the client request
Socket handler;

void WriteMessageToStderr(Exception objectDisposedException)
{
if (_started)
{
Console.Error.WriteLine("[{0}] Failure accepting new connection: {1}",
typeof(AsyncSocketListener).FullName,
objectDisposedException);
}
}

try
{
handler = listener.EndAccept(ar);
}
// The listener is stopped through a Dispose() call, which in turn causes
// Socket.EndAccept(IAsyncResult) to throw an exception:
// - up to .NET 6 ObjectDisposedException
// - since .NET 7 SocketException with OperationAborted - more info https://learn.microsoft.com/en-us/dotnet/core/compatibility/networking/7.0/socket-end-closed-sockets
//
// Since we consider this situation normal when the listener
// is being stopped, we only write a message to stderr if the listener
// is considered to be up and running
#if NET7_0_OR_GREATER
catch (SocketException ex) when (ex.SocketErrorCode == SocketError.OperationAborted)
{
WriteMessageToStderr(ex);

return;
}
#else
catch (ObjectDisposedException ex)
{
// The listener is stopped through a Dispose() call, which in turn causes
// Socket.EndAccept(IAsyncResult) to throw an ObjectDisposedException
//
// Since we consider this ObjectDisposedException normal when the listener
// is being stopped, we only write a message to stderr if the listener
// is considered to be up and running
if (_started)
{
Console.Error.WriteLine("[{0}] Failure accepting new connection: {1}",
typeof(AsyncSocketListener).FullName,
ex);
}
WriteMessageToStderr(ex);

return;
}
#endif

// Signal new connection
SignalConnected(handler);
Expand Down
6 changes: 3 additions & 3 deletions src/Renci.SshNet.Tests/Renci.SshNet.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@


<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="MSTest.TestAdapter" Version="2.2.8" />
<PackageReference Include="MSTest.TestFramework" Version="2.2.8" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.0.2" />
<PackageReference Include="MSTest.TestFramework" Version="3.0.2" />
<PackageReference Include="Moq" Version="4.16.1" />
</ItemGroup>
<ItemGroup>
Expand Down