Skip to content

Commit

Permalink
Enable parallel test execution for QUIC and HTTP/3 and enable some di…
Browse files Browse the repository at this point in the history
…sabled http3 tests (#102996)

* Revert "Disable parallel test execution for QUIC and HTTP/3 (#101569)"

This reverts commit 009d74e.

* Revert "Disable frequently failing tests (#101439)"

This reverts commit e01db17.

* Delete whitespace

* Style changes
  • Loading branch information
liveans authored Jun 4, 2024
1 parent db5e98d commit 3c96cb8
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ private static CookieContainer CreateSingleCookieContainer(Uri uri, string cooki
private static string GetCookieHeaderValue(string cookieName, string cookieValue) => $"{cookieName}={cookieValue}";

[Fact]
public virtual async Task GetAsync_DefaultCoookieContainer_NoCookieSent()
public async Task GetAsync_DefaultCoookieContainer_NoCookieSent()
{
await LoopbackServerFactory.CreateClientAndServerAsync(
async uri =>
Expand Down Expand Up @@ -216,15 +216,10 @@ private string GetCookieValue(HttpRequestData request)
return cookieHeaderValue;
}

[ConditionalFact]
[Fact]
[SkipOnPlatform(TestPlatforms.Browser, "CookieContainer is not supported on Browser")]
public async Task GetAsync_SetCookieContainerAndCookieHeader_BothCookiesSent()
{
if (UseVersion == HttpVersion30)
{
throw new SkipTestException("https://github.com/dotnet/runtime/issues/101377");
}

await LoopbackServerFactory.CreateServerAsync(async (server, url) =>
{
HttpClientHandler handler = CreateHttpClientHandler();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -988,7 +988,7 @@ await connection.WriteStringAsync(
});
}

[ConditionalTheory]
[Theory]
[InlineData(true, true, true)]
[InlineData(true, true, false)]
[InlineData(true, false, false)]
Expand All @@ -998,11 +998,6 @@ await connection.WriteStringAsync(
[ActiveIssue("https://github.com/dotnet/runtime/issues/65429", typeof(PlatformDetection), nameof(PlatformDetection.IsNodeJS))]
public async Task ReadAsStreamAsync_HandlerProducesWellBehavedResponseStream(bool? chunked, bool enableWasmStreaming, bool slowChunks)
{
if (UseVersion == HttpVersion30)
{
throw new SkipTestException("https://github.com/dotnet/runtime/issues/91757");
}

if (IsWinHttpHandler && UseVersion >= HttpVersion20.Value)
{
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
using System.Net.Test.Common;
using System.Net.Quic;

using Microsoft.DotNet.XUnitExtensions;

namespace System.Net.Http.Functional.Tests
{
public abstract class HttpClientHandler_AltSvc_Test : HttpClientHandlerTestBase
Expand All @@ -29,15 +27,10 @@ private HttpClient CreateHttpClient(Version version)
return client;
}

[ConditionalTheory]
[Theory]
[MemberData(nameof(AltSvcHeaderUpgradeVersions))]
public async Task AltSvc_Header_Upgrade_Success(Version fromVersion, bool overrideHost)
{
if (UseVersion == HttpVersion30 && fromVersion == HttpVersion.Version11 && overrideHost)
{
throw new SkipTestException("https://github.com/dotnet/runtime/issues/91757");
}

// The test makes a request to a HTTP/1 or HTTP/2 server first, which supplies an Alt-Svc header pointing to the second server.
using GenericLoopbackServer firstServer =
fromVersion.Major switch
Expand Down Expand Up @@ -78,14 +71,9 @@ public async Task AltSvc_Header_Upgrade_Success(Version fromVersion, bool overri
{ HttpVersion.Version20, false }
};

[ConditionalFact]
[Fact]
public async Task AltSvc_ConnectionFrame_UpgradeFrom20_Success()
{
if (UseVersion == HttpVersion30)
{
throw new SkipTestException("https://github.com/dotnet/runtime/issues/101376");
}

using Http2LoopbackServer firstServer = Http2LoopbackServer.CreateServer();
using Http3LoopbackServer secondServer = CreateHttp3LoopbackServer();
using HttpClient client = CreateHttpClient(HttpVersion.Version20);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
using Xunit;
using Xunit.Abstractions;

using Microsoft.DotNet.XUnitExtensions;

namespace System.Net.Http.Functional.Tests
{
using Configuration = System.Net.Test.Common.Configuration;
Expand Down Expand Up @@ -289,17 +287,12 @@ await LoopbackServerFactory.CreateClientAndServerAsync(async uri =>
});
}

[ConditionalTheory]
[Theory]
[InlineData("Thu, 01 Dec 1994 16:00:00 GMT", true)]
[InlineData("-1", false)]
[InlineData("0", false)]
public async Task SendAsync_Expires_Success(string value, bool isValid)
{
if (UseVersion == HttpVersion30)
{
throw new SkipTestException("https://github.com/dotnet/runtime/issues/91757");
}

await LoopbackServerFactory.CreateClientAndServerAsync(async uri =>
{
using (HttpClient client = CreateHttpClient())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1633,7 +1633,6 @@ public SocketsHttpHandler_HttpClientHandler_MaxResponseHeadersLength_Http2(ITest
protected override Version UseVersion => HttpVersion.Version20;
}

[Collection(nameof(DisableParallelization))]
[ConditionalClass(typeof(HttpClientHandlerTestBase), nameof(IsQuicSupported))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/91757")]
[ActiveIssue("https://github.com/dotnet/runtime/issues/101015")]
Expand Down Expand Up @@ -4028,51 +4027,41 @@ public SocketsHttpHandler_HttpClientHandler_Cancellation_Test_Http2(ITestOutputH
protected override Version UseVersion => HttpVersion.Version20;
}

[Collection(nameof(DisableParallelization))]
[ConditionalClass(typeof(HttpClientHandlerTestBase), nameof(IsQuicSupported))]
public sealed class SocketsHttpHandlerTest_HttpClientHandlerTest_Http3 : HttpClientHandlerTest
{
public SocketsHttpHandlerTest_HttpClientHandlerTest_Http3(ITestOutputHelper output) : base(output) { }
protected override Version UseVersion => HttpVersion.Version30;
}

[Collection(nameof(DisableParallelization))]
[ConditionalClass(typeof(HttpClientHandlerTestBase), nameof(IsQuicSupported))]
public sealed class SocketsHttpHandlerTest_Cookies_Http3 : HttpClientHandlerTest_Cookies
{
public SocketsHttpHandlerTest_Cookies_Http3(ITestOutputHelper output) : base(output) { }
protected override Version UseVersion => HttpVersion.Version30;

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/91757")]
public override Task GetAsync_DefaultCoookieContainer_NoCookieSent() { return null!; }
}

[Collection(nameof(DisableParallelization))]
[ConditionalClass(typeof(HttpClientHandlerTestBase), nameof(IsQuicSupported))]
public sealed class SocketsHttpHandlerTest_HttpClientHandlerTest_Headers_Http3 : HttpClientHandlerTest_Headers
{
public SocketsHttpHandlerTest_HttpClientHandlerTest_Headers_Http3(ITestOutputHelper output) : base(output) { }
protected override Version UseVersion => HttpVersion.Version30;
}

[Collection(nameof(DisableParallelization))]
[ConditionalClass(typeof(HttpClientHandlerTestBase), nameof(IsQuicSupported))]
public sealed class SocketsHttpHandler_HttpClientHandler_Cancellation_Test_Http3 : SocketsHttpHandler_Cancellation_Test
{
public SocketsHttpHandler_HttpClientHandler_Cancellation_Test_Http3(ITestOutputHelper output) : base(output) { }
protected override Version UseVersion => HttpVersion.Version30;
}

[Collection(nameof(DisableParallelization))]
[ConditionalClass(typeof(HttpClientHandlerTestBase), nameof(IsQuicSupported))]
public sealed class SocketsHttpHandler_HttpClientHandler_AltSvc_Test_Http3 : HttpClientHandler_AltSvc_Test
{
public SocketsHttpHandler_HttpClientHandler_AltSvc_Test_Http3(ITestOutputHelper output) : base(output) { }
protected override Version UseVersion => HttpVersion.Version30;
}

[Collection(nameof(DisableParallelization))]
[ConditionalClass(typeof(HttpClientHandlerTestBase), nameof(IsQuicSupported))]
public sealed class SocketsHttpHandler_HttpClientHandler_Finalization_Http3 : HttpClientHandler_Finalization_Test
{
Expand Down Expand Up @@ -4237,7 +4226,6 @@ public SocketsHttpHandler_RequestContentLengthMismatchTest_Http2(ITestOutputHelp
protected override Version UseVersion => HttpVersion.Version20;
}

[Collection(nameof(DisableParallelization))]
[ConditionalClass(typeof(HttpClientHandlerTestBase), nameof(IsQuicSupported))]
public sealed class SocketsHttpHandler_RequestContentLengthMismatchTest_Http3 : SocketsHttpHandler_RequestContentLengthMismatchTest
{
Expand Down Expand Up @@ -4414,7 +4402,6 @@ public SocketsHttpHandler_SocketsHttpHandler_SecurityTest_Http2(ITestOutputHelpe
protected override Version UseVersion => HttpVersion.Version20;
}

[Collection(nameof(DisableParallelization))]
[ConditionalClass(typeof(HttpClientHandlerTestBase), nameof(IsQuicSupported))]
public sealed class SocketsHttpHandler_SocketsHttpHandler_SecurityTest_Http3 : SocketsHttpHandler_SecurityTest
{
Expand Down Expand Up @@ -4543,7 +4530,6 @@ await Http11LoopbackServerFactory.Singleton.CreateClientAndServerAsync(async uri
}
}

[Collection(nameof(DisableParallelization))]
[ConditionalClass(typeof(HttpClientHandlerTestBase), nameof(IsQuicSupported))]
public sealed class SocketsHttpHandler_HttpRequestErrorTest_Http30 : SocketsHttpHandler_HttpRequestErrorTest
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

namespace System.Net.Quic.Tests;

[CollectionDefinition(nameof(QuicTestCollection), DisableParallelization = true)]
[CollectionDefinition(nameof(QuicTestCollection))]
public unsafe class QuicTestCollection : ICollectionFixture<QuicTestCollection>, IDisposable
{
public static bool IsSupported => QuicListener.IsSupported && QuicConnection.IsSupported;
Expand Down

0 comments on commit 3c96cb8

Please sign in to comment.