Przeglądaj źródła

Merge branch 'develop'

drieseng 4 lat temu
rodzic
commit
8737fdb386
14 zmienionych plików z 37 dodań i 23 usunięć
  1. 2 1
      src/Renci.SshNet.Tests/Classes/Connection/DirectConnectorTest_Connect_ConnectionRefusedByServer.cs
  2. 2 1
      src/Renci.SshNet.Tests/Classes/Connection/DirectConnectorTest_Connect_ConnectionSucceeded.cs
  3. 3 2
      src/Renci.SshNet.Tests/Classes/Connection/DirectConnectorTest_Connect_TimeoutConnectingToServer.cs
  4. 2 1
      src/Renci.SshNet.Tests/Classes/Connection/HttpConnectorTest_Connect_ConnectionToProxyRefused.cs
  5. 3 2
      src/Renci.SshNet.Tests/Classes/Connection/HttpConnectorTest_Connect_TimeoutConnectingToProxy.cs
  6. 3 2
      src/Renci.SshNet.Tests/Classes/Connection/HttpConnectorTest_Connect_TimeoutReadingHttpContent.cs
  7. 3 2
      src/Renci.SshNet.Tests/Classes/Connection/HttpConnectorTest_Connect_TimeoutReadingStatusLine.cs
  8. 2 1
      src/Renci.SshNet.Tests/Classes/Connection/Socks4ConnectorTest_Connect_ConnectionToProxyRefused.cs
  9. 3 2
      src/Renci.SshNet.Tests/Classes/Connection/Socks4ConnectorTest_Connect_TimeoutConnectingToProxy.cs
  10. 3 2
      src/Renci.SshNet.Tests/Classes/Connection/Socks4ConnectorTest_Connect_TimeoutReadingDestinationAddress.cs
  11. 3 2
      src/Renci.SshNet.Tests/Classes/Connection/Socks4ConnectorTest_Connect_TimeoutReadingReplyCode.cs
  12. 3 2
      src/Renci.SshNet.Tests/Classes/Connection/Socks4ConnectorTest_Connect_TimeoutReadingReplyVersion.cs
  13. 2 1
      src/Renci.SshNet.Tests/Classes/Connection/Socks5ConnectorTest_Connect_ConnectionToProxyRefused.cs
  14. 3 2
      src/Renci.SshNet.Tests/Classes/Connection/Socks5ConnectorTest_Connect_TimeoutConnectingToProxy.cs

+ 2 - 1
src/Renci.SshNet.Tests/Classes/Connection/DirectConnectorTest_Connect_ConnectionRefusedByServer.cs

@@ -77,7 +77,8 @@ namespace Renci.SshNet.Tests.Classes.Connection
                                           _stopWatch.ElapsedMilliseconds,
                                           _connectionInfo.Timeout.TotalMilliseconds);
 
-            Assert.IsTrue(_stopWatch.ElapsedMilliseconds < _connectionInfo.Timeout.TotalMilliseconds, errorText);
+            // Compare elapsed time with configured timeout, allowing for a margin of error
+            Assert.IsTrue(_stopWatch.ElapsedMilliseconds < _connectionInfo.Timeout.TotalMilliseconds + 100, errorText);
         }
 
         [TestMethod]

+ 2 - 1
src/Renci.SshNet.Tests/Classes/Connection/DirectConnectorTest_Connect_ConnectionSucceeded.cs

@@ -88,7 +88,8 @@ namespace Renci.SshNet.Tests.Classes.Connection
                                           _stopWatch.ElapsedMilliseconds,
                                           _connectionInfo.Timeout.TotalMilliseconds);
 
-            Assert.IsTrue(_stopWatch.ElapsedMilliseconds < (_connectionInfo.Timeout.TotalMilliseconds + 100), errorText);
+            // Compare elapsed time with configured timeout, allowing for a margin of error
+            Assert.IsTrue(_stopWatch.ElapsedMilliseconds < _connectionInfo.Timeout.TotalMilliseconds + 100, errorText);
         }
 
         [TestMethod]

+ 3 - 2
src/Renci.SshNet.Tests/Classes/Connection/DirectConnectorTest_Connect_TimeoutConnectingToServer.cs

@@ -81,8 +81,9 @@ namespace Renci.SshNet.Tests.Classes.Connection
                                           _stopWatch.ElapsedMilliseconds,
                                           _connectionInfo.Timeout.TotalMilliseconds);
 
-            Assert.IsTrue(_stopWatch.ElapsedMilliseconds >= _connectionInfo.Timeout.TotalMilliseconds, errorText);
-            Assert.IsTrue(_stopWatch.ElapsedMilliseconds < (_connectionInfo.Timeout.TotalMilliseconds + 100), errorText);
+            // Compare elapsed time with configured timeout, allowing for a margin of error
+            Assert.IsTrue(_stopWatch.ElapsedMilliseconds >= _connectionInfo.Timeout.TotalMilliseconds - 10, errorText);
+            Assert.IsTrue(_stopWatch.ElapsedMilliseconds < _connectionInfo.Timeout.TotalMilliseconds + 100, errorText);
         }
 
         [TestMethod]

+ 2 - 1
src/Renci.SshNet.Tests/Classes/Connection/HttpConnectorTest_Connect_ConnectionToProxyRefused.cs

@@ -85,7 +85,8 @@ namespace Renci.SshNet.Tests.Classes.Connection
                                           _stopWatch.ElapsedMilliseconds,
                                           _connectionInfo.Timeout.TotalMilliseconds);
 
-            Assert.IsTrue(_stopWatch.ElapsedMilliseconds < _connectionInfo.Timeout.TotalMilliseconds, errorText);
+            // Compare elapsed time with configured timeout, allowing for a margin of error
+            Assert.IsTrue(_stopWatch.ElapsedMilliseconds < _connectionInfo.Timeout.TotalMilliseconds + 100, errorText);
         }
 
         [TestMethod]

+ 3 - 2
src/Renci.SshNet.Tests/Classes/Connection/HttpConnectorTest_Connect_TimeoutConnectingToProxy.cs

@@ -88,8 +88,9 @@ namespace Renci.SshNet.Tests.Classes.Connection
                                           _stopWatch.ElapsedMilliseconds,
                                           _connectionInfo.Timeout.TotalMilliseconds);
 
-            Assert.IsTrue(_stopWatch.ElapsedMilliseconds >= _connectionInfo.Timeout.TotalMilliseconds, errorText);
-            Assert.IsTrue(_stopWatch.ElapsedMilliseconds < (_connectionInfo.Timeout.TotalMilliseconds + 100), errorText);
+            // Compare elapsed time with configured timeout, allowing for a margin of error
+            Assert.IsTrue(_stopWatch.ElapsedMilliseconds >= _connectionInfo.Timeout.TotalMilliseconds - 10, errorText);
+            Assert.IsTrue(_stopWatch.ElapsedMilliseconds < _connectionInfo.Timeout.TotalMilliseconds + 100, errorText);
         }
 
         [TestMethod]

+ 3 - 2
src/Renci.SshNet.Tests/Classes/Connection/HttpConnectorTest_Connect_TimeoutReadingHttpContent.cs

@@ -135,8 +135,9 @@ namespace Renci.SshNet.Tests.Classes.Connection
                                           _stopWatch.ElapsedMilliseconds,
                                           _connectionInfo.Timeout.TotalMilliseconds);
 
-            Assert.IsTrue(_stopWatch.ElapsedMilliseconds >= _connectionInfo.Timeout.TotalMilliseconds, errorText);
-            Assert.IsTrue(_stopWatch.ElapsedMilliseconds < (_connectionInfo.Timeout.TotalMilliseconds + 100), errorText);
+            // Compare elapsed time with configured timeout, allowing for a margin of error
+            Assert.IsTrue(_stopWatch.ElapsedMilliseconds >= _connectionInfo.Timeout.TotalMilliseconds - 10, errorText);
+            Assert.IsTrue(_stopWatch.ElapsedMilliseconds < _connectionInfo.Timeout.TotalMilliseconds + 100, errorText);
         }
 
         [TestMethod]

+ 3 - 2
src/Renci.SshNet.Tests/Classes/Connection/HttpConnectorTest_Connect_TimeoutReadingStatusLine.cs

@@ -105,8 +105,9 @@ namespace Renci.SshNet.Tests.Classes.Connection
                                           _stopWatch.ElapsedMilliseconds,
                                           _connectionInfo.Timeout.TotalMilliseconds);
 
-            Assert.IsTrue(_stopWatch.ElapsedMilliseconds >= _connectionInfo.Timeout.TotalMilliseconds, errorText);
-            Assert.IsTrue(_stopWatch.ElapsedMilliseconds < (_connectionInfo.Timeout.TotalMilliseconds + 100), errorText);
+            // Compare elapsed time with configured timeout, allowing for a margin of error
+            Assert.IsTrue(_stopWatch.ElapsedMilliseconds >= _connectionInfo.Timeout.TotalMilliseconds - 10, errorText);
+            Assert.IsTrue(_stopWatch.ElapsedMilliseconds < _connectionInfo.Timeout.TotalMilliseconds + 100, errorText);
         }
 
         [TestMethod]

+ 2 - 1
src/Renci.SshNet.Tests/Classes/Connection/Socks4ConnectorTest_Connect_ConnectionToProxyRefused.cs

@@ -76,7 +76,8 @@ namespace Renci.SshNet.Tests.Classes.Connection
                                           _stopWatch.ElapsedMilliseconds,
                                           _connectionInfo.Timeout.TotalMilliseconds);
 
-            Assert.IsTrue(_stopWatch.ElapsedMilliseconds < _connectionInfo.Timeout.TotalMilliseconds, errorText);
+            // Compare elapsed time with configured timeout, allowing for a margin of error
+            Assert.IsTrue(_stopWatch.ElapsedMilliseconds < _connectionInfo.Timeout.TotalMilliseconds + 100, errorText);
         }
 
         [TestMethod]

+ 3 - 2
src/Renci.SshNet.Tests/Classes/Connection/Socks4ConnectorTest_Connect_TimeoutConnectingToProxy.cs

@@ -78,8 +78,9 @@ namespace Renci.SshNet.Tests.Classes.Connection
                                           _stopWatch.ElapsedMilliseconds,
                                           _connectionInfo.Timeout.TotalMilliseconds);
 
-            Assert.IsTrue(_stopWatch.ElapsedMilliseconds >= _connectionInfo.Timeout.TotalMilliseconds, errorText);
-            Assert.IsTrue(_stopWatch.ElapsedMilliseconds < (_connectionInfo.Timeout.TotalMilliseconds + 100), errorText);
+            // Compare elapsed time with configured timeout, allowing for a margin of error
+            Assert.IsTrue(_stopWatch.ElapsedMilliseconds >= _connectionInfo.Timeout.TotalMilliseconds - 10, errorText);
+            Assert.IsTrue(_stopWatch.ElapsedMilliseconds < _connectionInfo.Timeout.TotalMilliseconds + 100, errorText);
         }
 
         [TestMethod]

+ 3 - 2
src/Renci.SshNet.Tests/Classes/Connection/Socks4ConnectorTest_Connect_TimeoutReadingDestinationAddress.cs

@@ -109,8 +109,9 @@ namespace Renci.SshNet.Tests.Classes.Connection
                                           _stopWatch.ElapsedMilliseconds,
                                           _connectionInfo.Timeout.TotalMilliseconds);
 
-            Assert.IsTrue(_stopWatch.ElapsedMilliseconds >= _connectionInfo.Timeout.TotalMilliseconds, errorText);
-            Assert.IsTrue(_stopWatch.ElapsedMilliseconds < (_connectionInfo.Timeout.TotalMilliseconds + 100), errorText);
+            // Compare elapsed time with configured timeout, allowing for a margin of error
+            Assert.IsTrue(_stopWatch.ElapsedMilliseconds >= _connectionInfo.Timeout.TotalMilliseconds - 10, errorText);
+            Assert.IsTrue(_stopWatch.ElapsedMilliseconds < _connectionInfo.Timeout.TotalMilliseconds + 100, errorText);
         }
 
         [TestMethod]

+ 3 - 2
src/Renci.SshNet.Tests/Classes/Connection/Socks4ConnectorTest_Connect_TimeoutReadingReplyCode.cs

@@ -105,8 +105,9 @@ namespace Renci.SshNet.Tests.Classes.Connection
                                           _stopWatch.ElapsedMilliseconds,
                                           _connectionInfo.Timeout.TotalMilliseconds);
 
-            Assert.IsTrue(_stopWatch.ElapsedMilliseconds >= _connectionInfo.Timeout.TotalMilliseconds, errorText);
-            Assert.IsTrue(_stopWatch.ElapsedMilliseconds < (_connectionInfo.Timeout.TotalMilliseconds + 100), errorText);
+            // Compare elapsed time with configured timeout, allowing for a margin of error
+            Assert.IsTrue(_stopWatch.ElapsedMilliseconds >= _connectionInfo.Timeout.TotalMilliseconds - 10, errorText);
+            Assert.IsTrue(_stopWatch.ElapsedMilliseconds < _connectionInfo.Timeout.TotalMilliseconds + 100, errorText);
         }
 
         [TestMethod]

+ 3 - 2
src/Renci.SshNet.Tests/Classes/Connection/Socks4ConnectorTest_Connect_TimeoutReadingReplyVersion.cs

@@ -97,8 +97,9 @@ namespace Renci.SshNet.Tests.Classes.Connection
                                           _stopWatch.ElapsedMilliseconds,
                                           _connectionInfo.Timeout.TotalMilliseconds);
 
-            Assert.IsTrue(_stopWatch.ElapsedMilliseconds >= _connectionInfo.Timeout.TotalMilliseconds, errorText);
-            Assert.IsTrue(_stopWatch.ElapsedMilliseconds < (_connectionInfo.Timeout.TotalMilliseconds + 100), errorText);
+            // Compare elapsed time with configured timeout, allowing for a margin of error
+            Assert.IsTrue(_stopWatch.ElapsedMilliseconds >= _connectionInfo.Timeout.TotalMilliseconds - 10, errorText);
+            Assert.IsTrue(_stopWatch.ElapsedMilliseconds < _connectionInfo.Timeout.TotalMilliseconds + 100, errorText);
         }
 
         [TestMethod]

+ 2 - 1
src/Renci.SshNet.Tests/Classes/Connection/Socks5ConnectorTest_Connect_ConnectionToProxyRefused.cs

@@ -77,7 +77,8 @@ namespace Renci.SshNet.Tests.Classes.Connection
                                           _stopWatch.ElapsedMilliseconds,
                                           _connectionInfo.Timeout.TotalMilliseconds);
 
-            Assert.IsTrue(_stopWatch.ElapsedMilliseconds < _connectionInfo.Timeout.TotalMilliseconds, errorText);
+            // Compare elapsed time with configured timeout, allowing for a margin of error
+            Assert.IsTrue(_stopWatch.ElapsedMilliseconds < _connectionInfo.Timeout.TotalMilliseconds + 100, errorText);
         }
 
         [TestMethod]

+ 3 - 2
src/Renci.SshNet.Tests/Classes/Connection/Socks5ConnectorTest_Connect_TimeoutConnectingToProxy.cs

@@ -80,8 +80,9 @@ namespace Renci.SshNet.Tests.Classes.Connection
                                           _stopWatch.ElapsedMilliseconds,
                                           _connectionInfo.Timeout.TotalMilliseconds);
 
-            Assert.IsTrue(_stopWatch.ElapsedMilliseconds >= _connectionInfo.Timeout.TotalMilliseconds, errorText);
-            Assert.IsTrue(_stopWatch.ElapsedMilliseconds < (_connectionInfo.Timeout.TotalMilliseconds + 100), errorText);
+            // Compare elapsed time with configured timeout, allowing for a margin of error
+            Assert.IsTrue(_stopWatch.ElapsedMilliseconds >= _connectionInfo.Timeout.TotalMilliseconds - 10, errorText);
+            Assert.IsTrue(_stopWatch.ElapsedMilliseconds < _connectionInfo.Timeout.TotalMilliseconds + 100, errorText);
         }
 
         [TestMethod]