Close timeout increased to 20 seconds (#34999)
authorAlexander Nikolaev <55398552+alnikola@users.noreply.github.com>
Wed, 15 Apr 2020 17:16:45 +0000 (19:16 +0200)
committerGitHub <noreply@github.com>
Wed, 15 Apr 2020 17:16:45 +0000 (19:16 +0200)
CloseOutputAsync_Cancel_Success tests are failing due to 2 reasons:
1. `Assert` expecting the state to be `Aborted`, finds it's `Open` - most frequent
2. Connection gets forcibly terminated on a connect attempt

However, the second failure type is not specific to this test because it affects many tests in different types during the same time. Thus, it seems to be an infra issue.
This PR fixes only the first failure type by increasing Close operation timeout.
Fixes #1725

src/libraries/System.Net.WebSockets.Client/tests/CancelTest.cs

index 30cd92e..434ced6 100644 (file)
@@ -75,7 +75,7 @@ namespace System.Net.WebSockets.Client.Tests
             await TestCancellation(async (cws) =>
             {
                 var ctsDefault = new CancellationTokenSource(TimeOutMilliseconds);
-                var cts = new CancellationTokenSource(5);
+                var cts = new CancellationTokenSource(TimeOutMilliseconds);
 
                 await cws.SendAsync(
                     WebSocketData.GetBufferFromText(".delay5sec"),
@@ -97,7 +97,7 @@ namespace System.Net.WebSockets.Client.Tests
             await TestCancellation(async (cws) =>
             {
 
-                var cts = new CancellationTokenSource(5);
+                var cts = new CancellationTokenSource(TimeOutMilliseconds);
                 var ctsDefault = new CancellationTokenSource(TimeOutMilliseconds);
 
                 await cws.SendAsync(