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..24de3c8e9d6044 --- /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; +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 + _ = OperatingSystem.IsLinux() && QuicConnection.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..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,11 +9,13 @@ $(NoWarn);SYSLIB0014 true + true +