From b2f65f0da2db901dfe6f1fa1ffe247cd544ac0b8 Mon Sep 17 00:00:00 2001 From: wfurt Date: Tue, 8 Feb 2022 21:10:05 +0000 Subject: [PATCH 1/2] update expected exception for cases when all requested TLS versions are disabled --- .../System/Net/Http/HttpClientHandlerTest.SslProtocols.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.SslProtocols.cs b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.SslProtocols.cs index 5a643c09aec385..d6ecb3bca3a2dc 100644 --- a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.SslProtocols.cs +++ b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.SslProtocols.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Collections.Generic; +using System.ComponentModel; using System.IO; using System.Net.Security; using System.Net.Test.Common; @@ -294,9 +295,10 @@ await LoopbackServer.CreateServerAsync(async (server, url) => { await serverTask; } - catch (Exception e) when (e is IOException || e is AuthenticationException) + catch (Exception e) when (e is IOException || e is AuthenticationException || e is Win32Exception) { // Some SSL implementations simply close or reset connection after protocol mismatch. + // The call may fail if neither of the requested protocols is available // Newer OpenSSL sends Fatal Alert message before closing. return; } From 22d5e79bbed48ec124523dfd9ab912ccdd60941a Mon Sep 17 00:00:00 2001 From: Dan Moseley Date: Thu, 10 Feb 2022 11:47:46 -0700 Subject: [PATCH 2/2] port test fix --- .../System.IO.FileSystem/tests/Directory/CreateDirectory.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libraries/System.IO.FileSystem/tests/Directory/CreateDirectory.cs b/src/libraries/System.IO.FileSystem/tests/Directory/CreateDirectory.cs index fb3a74305bca2c..4e53a93a4e03a9 100644 --- a/src/libraries/System.IO.FileSystem/tests/Directory/CreateDirectory.cs +++ b/src/libraries/System.IO.FileSystem/tests/Directory/CreateDirectory.cs @@ -270,8 +270,10 @@ public void DirectoryLongerThanMaxLongPathWithExtendedSyntax_ThrowsException() { var paths = IOInputs.GetPathsLongerThanMaxLongPath(GetTestFilePath(), useExtendedSyntax: true); + // Ideally this should be PathTooLongException or DirectoryNotFoundException but on some machines + // windows gives us ERROR_INVALID_NAME, producing IOException. Assert.All(paths, path => - AssertExtensions.ThrowsAny(() => Create(path))); + AssertExtensions.ThrowsAny(() => Create(path))); } [ConditionalFact(nameof(LongPathsAreNotBlocked), nameof(UsingNewNormalization))]