From 44823680b612e0ca6bb2f147ba0d0e74b5223459 Mon Sep 17 00:00:00 2001 From: wfurt Date: Sun, 11 Sep 2022 15:26:53 -0700 Subject: [PATCH 1/5] load quic early --- .../Common/tests/System/Net/Capability.Quic.cs | 17 +++++++++++++++++ .../tests/System.Net.Requests.Tests.csproj | 5 +++++ 2 files changed, 22 insertions(+) create mode 100644 src/libraries/Common/tests/System/Net/Capability.Quic.cs diff --git a/src/libraries/Common/tests/System/Net/Capability.Quic.cs b/src/libraries/Common/tests/System/Net/Capability.Quic.cs new file mode 100644 index 00000000000000..d7c84c808a2dea --- /dev/null +++ b/src/libraries/Common/tests/System/Net/Capability.Quic.cs @@ -0,0 +1,17 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Net.Quic; +using System.Threading; + +namespace System.Net.Test.Common +{ + public static partial class Capability + { + public static bool IsQuicSupported = GetIsQuicSupported(); + private static bool GetIsQuicSupported() + { + return QuicConnection.IsSupported && QuicListener.IsSupported; + } + } +} diff --git a/src/libraries/System.Net.Requests/tests/System.Net.Requests.Tests.csproj b/src/libraries/System.Net.Requests/tests/System.Net.Requests.Tests.csproj index 868d3582b442a1..0054c647ed5910 100644 --- a/src/libraries/System.Net.Requests/tests/System.Net.Requests.Tests.csproj +++ b/src/libraries/System.Net.Requests/tests/System.Net.Requests.Tests.csproj @@ -10,12 +10,17 @@ true + + + + Date: Sun, 11 Sep 2022 22:23:34 -0700 Subject: [PATCH 2/5] feedback from review --- .../tests/System/Net/Capability.Quic.cs | 17 -------------- .../System.Net.Requests/tests/QuicLoad.cs | 22 +++++++++++++++++++ .../tests/System.Net.Requests.Tests.csproj | 7 ++---- 3 files changed, 24 insertions(+), 22 deletions(-) delete mode 100644 src/libraries/Common/tests/System/Net/Capability.Quic.cs create mode 100644 src/libraries/System.Net.Requests/tests/QuicLoad.cs diff --git a/src/libraries/Common/tests/System/Net/Capability.Quic.cs b/src/libraries/Common/tests/System/Net/Capability.Quic.cs deleted file mode 100644 index d7c84c808a2dea..00000000000000 --- a/src/libraries/Common/tests/System/Net/Capability.Quic.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Net.Quic; -using System.Threading; - -namespace System.Net.Test.Common -{ - public static partial class Capability - { - public static bool IsQuicSupported = GetIsQuicSupported(); - private static bool GetIsQuicSupported() - { - return QuicConnection.IsSupported && QuicListener.IsSupported; - } - } -} diff --git a/src/libraries/System.Net.Requests/tests/QuicLoad.cs b/src/libraries/System.Net.Requests/tests/QuicLoad.cs new file mode 100644 index 00000000000000..daf5fe895c130c --- /dev/null +++ b/src/libraries/System.Net.Requests/tests/QuicLoad.cs @@ -0,0 +1,22 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Net.Quic; +using System.Runtime.CompilerServices; + + +namespace System.Net.Test.Common +{ + public static class QuicLoad + { + [ModuleInitializer] + internal static void InitializeQuic() + { + // This will load Quic (if supported) to avoid interference with RemoteExecutor + // See https://github.com/dotnet/runtime/pull/75424 for more details + // IsSupported currently does not unload lttng. If it does in the future, + // we may need to call some real Quic API here to get everything loaded properly + _ = QuicConnection.IsSupported && QuicListener.IsSupported; + } + } +} diff --git a/src/libraries/System.Net.Requests/tests/System.Net.Requests.Tests.csproj b/src/libraries/System.Net.Requests/tests/System.Net.Requests.Tests.csproj index 0054c647ed5910..0e063a6e12a0f9 100644 --- a/src/libraries/System.Net.Requests/tests/System.Net.Requests.Tests.csproj +++ b/src/libraries/System.Net.Requests/tests/System.Net.Requests.Tests.csproj @@ -9,18 +9,15 @@ $(NoWarn);SYSLIB0014 true + true - - - + - Date: Sun, 11 Sep 2022 22:24:43 -0700 Subject: [PATCH 3/5] enable tests again on Mono --- src/libraries/System.Net.Requests/tests/AssemblyInfo.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/libraries/System.Net.Requests/tests/AssemblyInfo.cs b/src/libraries/System.Net.Requests/tests/AssemblyInfo.cs index 6fa7258c2c242e..ef5fa4660024d7 100644 --- a/src/libraries/System.Net.Requests/tests/AssemblyInfo.cs +++ b/src/libraries/System.Net.Requests/tests/AssemblyInfo.cs @@ -5,4 +5,3 @@ using Xunit; [assembly: SkipOnPlatform(TestPlatforms.Browser, "System.Net.Requests is not supported on Browser.")] -[assembly: ActiveIssue("https://github.com/dotnet/runtime/issues/74795", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoLinuxArm64))] From 11ce92c373d2339df3ba2a1c94cffa6c8ef9e894 Mon Sep 17 00:00:00 2001 From: Jan Kotas Date: Mon, 12 Sep 2022 07:08:53 -0700 Subject: [PATCH 4/5] Update src/libraries/System.Net.Requests/tests/QuicLoad.cs --- src/libraries/System.Net.Requests/tests/QuicLoad.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/System.Net.Requests/tests/QuicLoad.cs b/src/libraries/System.Net.Requests/tests/QuicLoad.cs index daf5fe895c130c..761c15a04caf81 100644 --- a/src/libraries/System.Net.Requests/tests/QuicLoad.cs +++ b/src/libraries/System.Net.Requests/tests/QuicLoad.cs @@ -16,7 +16,7 @@ internal static void InitializeQuic() // See https://github.com/dotnet/runtime/pull/75424 for more details // IsSupported currently does not unload lttng. If it does in the future, // we may need to call some real Quic API here to get everything loaded properly - _ = QuicConnection.IsSupported && QuicListener.IsSupported; + _ = OperatingSystem.IsLinux() && QuicConnection.IsSupported; } } } From fde9faee930ed4b8585617344dedb97495ded58b Mon Sep 17 00:00:00 2001 From: Jan Kotas Date: Mon, 12 Sep 2022 07:09:15 -0700 Subject: [PATCH 5/5] Update src/libraries/System.Net.Requests/tests/QuicLoad.cs --- src/libraries/System.Net.Requests/tests/QuicLoad.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/System.Net.Requests/tests/QuicLoad.cs b/src/libraries/System.Net.Requests/tests/QuicLoad.cs index 761c15a04caf81..24de3c8e9d6044 100644 --- a/src/libraries/System.Net.Requests/tests/QuicLoad.cs +++ b/src/libraries/System.Net.Requests/tests/QuicLoad.cs @@ -1,10 +1,10 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System; using System.Net.Quic; using System.Runtime.CompilerServices; - namespace System.Net.Test.Common { public static class QuicLoad