Skip to content

Commit c30ea34

Browse files
authored
Run MsQuic tests in parallel again. (#100947)
* Run MsQuic tests in parallel. * Removed workarounds in other parts of the code. * Remove filter in active issue for failing test * Remove extra property
1 parent 55e3c59 commit c30ea34

File tree

5 files changed

+7
-34
lines changed

5 files changed

+7
-34
lines changed

src/libraries/System.Net.Http/tests/FunctionalTests/SocketsHttpHandlerTest.cs

+2-9
Original file line numberDiff line numberDiff line change
@@ -4024,47 +4024,41 @@ public SocketsHttpHandler_HttpClientHandler_Cancellation_Test_Http2(ITestOutputH
40244024
protected override Version UseVersion => HttpVersion.Version20;
40254025
}
40264026

4027-
[Collection(nameof(DisableParallelization))]
40284027
[ConditionalClass(typeof(HttpClientHandlerTestBase), nameof(IsQuicSupported))]
40294028
public sealed class SocketsHttpHandlerTest_HttpClientHandlerTest_Http3 : HttpClientHandlerTest
40304029
{
40314030
public SocketsHttpHandlerTest_HttpClientHandlerTest_Http3(ITestOutputHelper output) : base(output) { }
40324031
protected override Version UseVersion => HttpVersion.Version30;
40334032
}
40344033

4035-
[Collection(nameof(DisableParallelization))]
40364034
[ConditionalClass(typeof(HttpClientHandlerTestBase), nameof(IsQuicSupported))]
40374035
public sealed class SocketsHttpHandlerTest_Cookies_Http3 : HttpClientHandlerTest_Cookies
40384036
{
40394037
public SocketsHttpHandlerTest_Cookies_Http3(ITestOutputHelper output) : base(output) { }
40404038
protected override Version UseVersion => HttpVersion.Version30;
40414039
}
40424040

4043-
[Collection(nameof(DisableParallelization))]
40444041
[ConditionalClass(typeof(HttpClientHandlerTestBase), nameof(IsQuicSupported))]
40454042
public sealed class SocketsHttpHandlerTest_HttpClientHandlerTest_Headers_Http3 : HttpClientHandlerTest_Headers
40464043
{
40474044
public SocketsHttpHandlerTest_HttpClientHandlerTest_Headers_Http3(ITestOutputHelper output) : base(output) { }
40484045
protected override Version UseVersion => HttpVersion.Version30;
40494046
}
40504047

4051-
[Collection(nameof(DisableParallelization))]
40524048
[ConditionalClass(typeof(HttpClientHandlerTestBase), nameof(IsQuicSupported))]
40534049
public sealed class SocketsHttpHandler_HttpClientHandler_Cancellation_Test_Http3 : SocketsHttpHandler_Cancellation_Test
40544050
{
40554051
public SocketsHttpHandler_HttpClientHandler_Cancellation_Test_Http3(ITestOutputHelper output) : base(output) { }
40564052
protected override Version UseVersion => HttpVersion.Version30;
40574053
}
40584054

4059-
[Collection(nameof(DisableParallelization))]
40604055
[ConditionalClass(typeof(HttpClientHandlerTestBase), nameof(IsQuicSupported))]
40614056
public sealed class SocketsHttpHandler_HttpClientHandler_AltSvc_Test_Http3 : HttpClientHandler_AltSvc_Test
40624057
{
40634058
public SocketsHttpHandler_HttpClientHandler_AltSvc_Test_Http3(ITestOutputHelper output) : base(output) { }
40644059
protected override Version UseVersion => HttpVersion.Version30;
40654060
}
40664061

4067-
[Collection(nameof(DisableParallelization))]
40684062
[ConditionalClass(typeof(HttpClientHandlerTestBase), nameof(IsQuicSupported))]
40694063
public sealed class SocketsHttpHandler_HttpClientHandler_Finalization_Http3 : HttpClientHandler_Finalization_Test
40704064
{
@@ -4328,7 +4322,7 @@ await LoopbackServerFactory.CreateClientAndServerAsync(
43284322
};
43294323

43304324
policy.ExtraStore.AddRange(caCerts);
4331-
policy.CustomTrustStore.Add(caCerts[caCerts.Count -1]);
4325+
policy.CustomTrustStore.Add(caCerts[caCerts.Count - 1]);
43324326
socketsHandler.SslOptions = new SslClientAuthenticationOptions() { CertificateChainPolicy = policy };
43334327

43344328
using HttpClient client = CreateHttpClient(handler);
@@ -4490,7 +4484,7 @@ await LoopbackServerFactory.CreateClientAndServerAsync(async uri =>
44904484
options: new GenericLoopbackOptions() { UseSsl = true });
44914485
}
44924486

4493-
4487+
44944488
}
44954489

44964490
public sealed class SocketsHttpHandler_HttpRequestErrorTest_Http11 : SocketsHttpHandler_HttpRequestErrorTest
@@ -4533,7 +4527,6 @@ await Http11LoopbackServerFactory.Singleton.CreateClientAndServerAsync(async uri
45334527
}
45344528
}
45354529

4536-
[Collection(nameof(DisableParallelization))]
45374530
[ConditionalClass(typeof(HttpClientHandlerTestBase), nameof(IsQuicSupported))]
45384531
public sealed class SocketsHttpHandler_HttpRequestErrorTest_Http30 : SocketsHttpHandler_HttpRequestErrorTest
45394532
{

src/libraries/System.Net.Http/tests/StressTests/HttpStress/Program.cs

+2-20
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
using System.Net.Quic;
1717
using Microsoft.Quic;
1818

19-
[assembly:SupportedOSPlatform("windows")]
20-
[assembly:SupportedOSPlatform("linux")]
19+
[assembly: SupportedOSPlatform("windows")]
20+
[assembly: SupportedOSPlatform("linux")]
2121

2222
namespace HttpStress
2323
{
@@ -186,24 +186,6 @@ private static async Task<ExitCode> Run(Configuration config)
186186
Console.WriteLine("Query Parameters: " + config.MaxParameters);
187187
Console.WriteLine();
188188

189-
if (config.HttpVersion == HttpVersion.Version30 && IsQuicSupported)
190-
{
191-
unsafe
192-
{
193-
// If the system gets overloaded, MsQuic has a tendency to drop incoming connections, see https://github.com/dotnet/runtime/issues/55979.
194-
// So in case we're running H/3 stress test, we're using the same hack as for System.Net.Quic tests, which increases the time limit for pending operations in MsQuic thread pool.
195-
object msQuicApiInstance = msQuicApiType.GetProperty("Api", BindingFlags.NonPublic | BindingFlags.Static)!.GetGetMethod(true)!.Invoke(null, Array.Empty<object?>())!;
196-
QUIC_API_TABLE* apiTable = (QUIC_API_TABLE*)(Pointer.Unbox(msQuicApiType.GetProperty("ApiTable")!.GetGetMethod()!.Invoke(msQuicApiInstance, Array.Empty<object?>())!));
197-
QUIC_SETTINGS settings = default(QUIC_SETTINGS);
198-
settings.IsSet.MaxWorkerQueueDelayUs = 1;
199-
settings.MaxWorkerQueueDelayUs = 2_500_000u; // 2.5s, 10x the default
200-
if (MsQuic.StatusFailed(apiTable->SetParam(null, MsQuic.QUIC_PARAM_GLOBAL_SETTINGS, (uint)sizeof(QUIC_SETTINGS), (byte*)&settings)))
201-
{
202-
Console.WriteLine($"Unable to set MsQuic MaxWorkerQueueDelayUs.");
203-
}
204-
}
205-
}
206-
207189
StressServer? server = null;
208190
if (config.RunMode.HasFlag(RunMode.server))
209191
{

src/libraries/System.Net.Quic/src/System/Net/Quic/Internal/MsQuicApi.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ private MsQuicApi(QUIC_API_TABLE* apiTable)
6262
internal static string? NotSupportedReason { get; }
6363

6464
// workaround for https://github.com/microsoft/msquic/issues/4132
65-
internal static bool SupportsAsyncCertValidation => Version >= new Version(2, 4, 0);
65+
internal static bool SupportsAsyncCertValidation => Version >= new Version(2, 3, 5);
6666

6767
internal static bool UsesSChannelBackend { get; }
6868

src/libraries/System.Net.Quic/tests/FunctionalTests/MsQuicTests.cs

+1-3
Original file line numberDiff line numberDiff line change
@@ -357,10 +357,8 @@ public async Task UntrustedClientCertificateFails()
357357
}
358358
}
359359

360-
static bool SupportsAsyncCertValidation => QuicTestCollection.MsQuicVersion >= new Version(2, 4);
361-
362360
[Fact]
363-
[ActiveIssue("https://github.com/dotnet/runtime/issues/99074", typeof(MsQuicTests), nameof(SupportsAsyncCertValidation))]
361+
[ActiveIssue("https://github.com/dotnet/runtime/issues/99074")]
364362
public async Task CertificateCallbackThrowPropagates()
365363
{
366364
using CancellationTokenSource cts = new CancellationTokenSource(PassingTestTimeout);

src/libraries/System.Net.Quic/tests/FunctionalTests/QuicTestCollection.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
namespace System.Net.Quic.Tests;
1717

18-
[CollectionDefinition(nameof(QuicTestCollection), DisableParallelization = true)]
18+
[CollectionDefinition(nameof(QuicTestCollection))]
1919
public unsafe class QuicTestCollection : ICollectionFixture<QuicTestCollection>, IDisposable
2020
{
2121
public static bool IsSupported => QuicListener.IsSupported && QuicConnection.IsSupported;

0 commit comments

Comments
 (0)