Skip to content

Commit

Permalink
[wasm][tests][browser] Http - FunctionalTests - mark failing tests (#…
Browse files Browse the repository at this point in the history
…42866)

* [wasm][tests][browser] Http - FunctionalTests - mark failing tests

- Most of these are failing due to LoopbackServer
- some others are due to monitors not being supported

This brings the result to zero failures:

`Tests run: 439, Errors: 0, Failures: 0, Skipped: 18. Time: 2.128495s`

* Mark LoopbackServer issues with active issue

* fix the exclusion on browser

Co-authored-by: Larry Ewing <lewing@microsoft.com>
  • Loading branch information
radical and lewing authored Oct 11, 2020
1 parent 9d34507 commit 921db35
Show file tree
Hide file tree
Showing 11 changed files with 94 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ public static IEnumerable<object[]> Authentication_SocketsHttpHandler_TestData()

[Theory]
[MemberData(nameof(Authentication_TestData))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)]
public async Task HttpClientHandler_Authentication_Succeeds(string authenticateHeader, bool result)
{
if (PlatformDetection.IsWindowsNanoServer)
Expand Down Expand Up @@ -137,6 +138,7 @@ public async Task HttpClientHandler_MultipleAuthenticateHeaders_WithSameAuth_Suc
[Theory]
[InlineData("WWW-Authenticate: Basic realm=\"hello\"\r\nWWW-Authenticate: Digest realm=\"hello\", nonce=\"hello\", algorithm=MD5\r\n")]
[InlineData("WWW-Authenticate: Digest realm=\"hello\", nonce=\"hello\", algorithm=MD5\r\nWWW-Authenticate: Basic realm=\"hello\"\r\n")]
[ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)]
public async Task HttpClientHandler_MultipleAuthenticateHeaders_Succeeds(string authenticateHeader)
{
if (PlatformDetection.IsWindowsNanoServer)
Expand All @@ -156,6 +158,7 @@ await LoopbackServer.CreateServerAsync(async (server, url) =>
[Theory]
[InlineData("WWW-Authenticate: Basic realm=\"hello\"\r\nWWW-Authenticate: NTLM\r\n", "Basic", "Negotiate")]
[InlineData("WWW-Authenticate: Basic realm=\"hello\"\r\nWWW-Authenticate: Digest realm=\"hello\", nonce=\"hello\", algorithm=MD5\r\nWWW-Authenticate: NTLM\r\n", "Digest", "Negotiate")]
[ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)]
public async Task HttpClientHandler_MultipleAuthenticateHeaders_PicksSupported(string authenticateHeader, string supportedAuth, string unsupportedAuth)
{
if (PlatformDetection.IsWindowsNanoServer)
Expand All @@ -181,6 +184,7 @@ await LoopbackServer.CreateServerAsync(async (server, url) =>
[Theory]
[InlineData("WWW-Authenticate: Basic realm=\"hello\"\r\n")]
[InlineData("WWW-Authenticate: Digest realm=\"hello\", nonce=\"testnonce\"\r\n")]
[ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)]
public async Task HttpClientHandler_IncorrectCredentials_Fails(string authenticateHeader)
{
var options = new LoopbackServer.Options { Domain = Domain, Username = Username, Password = Password };
Expand Down Expand Up @@ -218,6 +222,7 @@ public static IEnumerable<object[]> Authentication_TestData()
[InlineData("NTLM")]
[InlineData("Kerberos")]
[InlineData("Negotiate")]
[ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)]
public async Task PreAuthenticate_NoPreviousAuthenticatedRequests_NoCredentialsSent(string credCacheScheme)
{
const int NumRequests = 3;
Expand Down Expand Up @@ -260,6 +265,7 @@ await LoopbackServer.CreateClientAndServerAsync(async uri =>
[Theory]
[InlineData(null, "WWW-Authenticate: Basic realm=\"hello\"\r\n")]
[InlineData("Basic", "WWW-Authenticate: Basic realm=\"hello\"\r\n")]
[ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)]
public async Task PreAuthenticate_FirstRequestNoHeaderAndAuthenticates_SecondRequestPreauthenticates(string credCacheScheme, string authResponse)
{
await LoopbackServer.CreateClientAndServerAsync(async uri =>
Expand Down Expand Up @@ -352,6 +358,7 @@ await LoopbackServer.CreateClientAndServerAsync(async uri =>
[InlineData((HttpStatusCode)508)] // LoopDetected
[InlineData((HttpStatusCode)510)] // NotExtended
[InlineData((HttpStatusCode)511)] // NetworkAuthenticationRequired
[ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)]
public async Task PreAuthenticate_FirstRequestNoHeader_SecondRequestVariousStatusCodes_ThirdRequestPreauthenticates(HttpStatusCode statusCode)
{
const string AuthResponse = "WWW-Authenticate: Basic realm=\"hello\"\r\n";
Expand Down Expand Up @@ -395,6 +402,7 @@ await LoopbackServer.CreateClientAndServerAsync(async uri =>
[InlineData("/something/hello.html", "/world.html", false)]
[InlineData("/something/hello.html", "/another/", false)]
[InlineData("/something/hello.html", "/another/hello.html", false)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)]
public async Task PreAuthenticate_AuthenticatedUrl_ThenTryDifferentUrl_SendsAuthHeaderOnlyIfPrefixMatches(
string originalRelativeUri, string secondRelativeUri, bool expectedAuthHeader)
{
Expand Down Expand Up @@ -434,6 +442,7 @@ await LoopbackServer.CreateClientAndServerAsync(async uri =>
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)]
public async Task PreAuthenticate_SuccessfulBasicButThenFails_DoesntLoopInfinitely()
{
await LoopbackServer.CreateClientAndServerAsync(async uri =>
Expand Down Expand Up @@ -472,6 +481,7 @@ await LoopbackServer.CreateClientAndServerAsync(async uri =>
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)]
public async Task PreAuthenticate_SuccessfulBasic_ThenDigestChallenged()
{
if (IsWinHttpHandler)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public static IEnumerable<object[]> RemoteServersAndCompressionUris()
[InlineData("deflate", true)]
[InlineData("br", false)]
[InlineData("br", true)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)]
public async Task DecompressedResponse_MethodSpecified_DecompressedContentReturned(string encodingName, bool all)
{
Func<Stream, Stream> compress;
Expand Down Expand Up @@ -135,6 +136,7 @@ public static IEnumerable<object[]> DecompressedResponse_MethodNotSpecified_Orig

[Theory]
[MemberData(nameof(DecompressedResponse_MethodNotSpecified_OriginalContentReturned_MemberData))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)]
public async Task DecompressedResponse_MethodNotSpecified_OriginalContentReturned(
string encodingName, Func<Stream, Stream> compress, DecompressionMethods methods)
{
Expand Down Expand Up @@ -254,6 +256,7 @@ public async Task GetAsync_SetAutomaticDecompression_HeadersRemoved(Configuratio
[InlineData(DecompressionMethods.Deflate, "deflate", "gzip")]
[InlineData(DecompressionMethods.Deflate, "deflate", "br")]
[InlineData(DecompressionMethods.GZip | DecompressionMethods.Deflate, "gzip, deflate", "gzip, deflate")]
[ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)]
public async Task GetAsync_SetAutomaticDecompression_AcceptEncodingHeaderSentWithNoDuplicates(
DecompressionMethods methods,
string encodings,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
// 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 Xunit;

[assembly: SkipOnCoreClr("System.Net.Tests are flaky and/or long running: https://github.com/dotnet/runtime/issues/131", RuntimeConfiguration.Checked)]
[assembly: ActiveIssue("https://github.com/dotnet/runtime/issues/131", TestRuntimes.Mono)] // System.Net.Tests are flaky and/or long running
[assembly: ActiveIssue("https://github.com/dotnet/runtime/issues/131", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoRuntime), nameof(PlatformDetection.IsNotBrowser))] // System.Net.Tests are flaky and/or long running

Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

namespace System.Net.Http.Functional.Tests
{
[ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))]
public class HPackTest : HttpClientHandlerTestBase
{
protected override Version UseVersion => HttpVersion.Version20;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public class HttpClientHandlerTest_Http1 : HttpClientHandlerTestBase
public HttpClientHandlerTest_Http1(ITestOutputHelper output) : base(output) { }

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)]
public async Task SendAsync_HostHeader_First()
{
// RFC 7230 3.2.2. Field Order
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@ public async Task GetAsync_CustomException_Asynchronous_ThrowsException()
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)]
public async Task GetStringAsync_Success()
{
string content = Guid.NewGuid().ToString();
Expand All @@ -368,6 +369,7 @@ await LoopbackServer.CreateClientAndServerAsync(
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)]
public async Task GetStringAsync_CanBeCanceled_AlreadyCanceledCts()
{
var onClientFinished = new SemaphoreSlim(0, 1);
Expand All @@ -390,6 +392,7 @@ await LoopbackServer.CreateClientAndServerAsync(
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)]
public async Task GetStringAsync_CanBeCanceled()
{
var cts = new CancellationTokenSource();
Expand Down Expand Up @@ -503,6 +506,7 @@ await server.AcceptConnectionAsync(async connection =>
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)]
public async Task GetByteArrayAsync_Success()
{
string content = Guid.NewGuid().ToString();
Expand All @@ -523,6 +527,7 @@ await LoopbackServer.CreateClientAndServerAsync(
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)]
public async Task GetByteArrayAsync_CanBeCanceled_AlreadyCanceledCts()
{
var onClientFinished = new SemaphoreSlim(0, 1);
Expand All @@ -545,6 +550,7 @@ await LoopbackServer.CreateClientAndServerAsync(
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)]
public async Task GetByteArrayAsync_CanBeCanceled()
{
var cts = new CancellationTokenSource();
Expand All @@ -571,6 +577,7 @@ await server.AcceptConnectionAsync(async connection =>
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)]
public async Task GetStreamAsync_Success()
{
string content = Guid.NewGuid().ToString();
Expand All @@ -594,6 +601,7 @@ await LoopbackServer.CreateClientAndServerAsync(
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)]
public async Task GetStreamAsync_CanBeCanceled_AlreadyCanceledCts()
{
var onClientFinished = new SemaphoreSlim(0, 1);
Expand All @@ -616,6 +624,7 @@ await LoopbackServer.CreateClientAndServerAsync(
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)]
public async Task GetStreamAsync_CanBeCanceled()
{
var cts = new CancellationTokenSource();
Expand Down Expand Up @@ -664,6 +673,7 @@ public void Dispose_UseAfterDispose_Throws()
[Theory]
[InlineData(false)]
[InlineData(true)]
[SkipOnMono("System.Net.Sockets is not supported on this platform", TestPlatforms.Browser)]
public void CancelAllPending_AllPendingOperationsCanceled(bool withInfiniteTimeout)
{
using (var client = new HttpClient(new CustomResponseHandler((r, c) => WhenCanceled<HttpResponseMessage>(c))))
Expand All @@ -681,6 +691,7 @@ public void CancelAllPending_AllPendingOperationsCanceled(bool withInfiniteTimeo
[Theory]
[InlineData(HttpCompletionOption.ResponseContentRead)]
[InlineData(HttpCompletionOption.ResponseHeadersRead)]
[SkipOnMono("System.Net.Sockets is not supported on this platform", TestPlatforms.Browser)]
public void Timeout_TooShort_AllPendingOperationsCanceled(HttpCompletionOption completionOption)
{
using (var client = new HttpClient(new CustomResponseHandler((r, c) => WhenCanceled<HttpResponseMessage>(c))))
Expand Down Expand Up @@ -716,6 +727,7 @@ public async Task Timeout_CallerCanceledTokenAfterTimeout_TimeoutIsNotDetected(H
[Theory]
[InlineData(HttpCompletionOption.ResponseContentRead)]
[InlineData(HttpCompletionOption.ResponseHeadersRead)]
[SkipOnMono("System.Net.Sockets is not supported on this platform", TestPlatforms.Browser)]
public void Timeout_CallerCanceledTokenBeforeTimeout_TimeoutIsNotDetected(HttpCompletionOption completionOption)
{
using (var client = new HttpClient(new CustomResponseHandler((r, c) => WhenCanceled<HttpResponseMessage>(c))))
Expand Down Expand Up @@ -867,6 +879,7 @@ public void Send_SingleThread_Succeeds(HttpCompletionOption completionOption)
[Theory]
[InlineData(HttpCompletionOption.ResponseContentRead)]
[InlineData(HttpCompletionOption.ResponseHeadersRead)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)]
public async Task Send_SingleThread_Loopback_Succeeds(HttpCompletionOption completionOption)
{
string content = "Test content";
Expand Down Expand Up @@ -1141,6 +1154,7 @@ public static IEnumerable<object[]> VersionSelectionMemberData()

[Theory]
[MemberData(nameof(VersionSelectionMemberData))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)]
public async Task SendAsync_CorrectVersionSelected_LoopbackServer(Version requestVersion, HttpVersionPolicy versionPolicy, Version serverVersion, bool useSsl, object expectedResult)
{
await HttpAgnosticLoopbackServer.CreateClientAndServerAsync(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

namespace System.Net.Http.Functional.Tests
{
[ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))]
public class HttpConnectionKeyTest
{
public static IEnumerable<object[]> KeyComponents()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ public async Task ReadAsStreamAsync_FirstGetFromUnbufferedContentThenGetFromBuff
Assert.Equal(before, after);
}

[SkipOnMono("Browser doesn't support Synchronous reads", TestPlatforms.Browser)]
[Theory]
[InlineData(true)]
[InlineData(false)]
Expand Down Expand Up @@ -612,6 +613,7 @@ public void Dispose_DisposedObjectThenAccessMembers_ThrowsObjectDisposedExceptio


[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)]
public async Task ReadAsStringAsync_Buffered_IgnoresCancellationToken()
{
string content = Guid.NewGuid().ToString();
Expand All @@ -638,6 +640,7 @@ await LoopbackServer.CreateClientAndServerAsync(
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)]
public async Task ReadAsStringAsync_Unbuffered_CanBeCanceled_AlreadyCanceledCts()
{
await LoopbackServer.CreateClientAndServerAsync(
Expand Down Expand Up @@ -665,6 +668,7 @@ await LoopbackServer.CreateClientAndServerAsync(
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)]
public async Task ReadAsStringAsync_Unbuffered_CanBeCanceled()
{
var cts = new CancellationTokenSource();
Expand Down Expand Up @@ -699,6 +703,7 @@ await server.AcceptConnectionAsync(async connection =>
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)]
public async Task ReadAsByteArrayAsync_Buffered_IgnoresCancellationToken()
{
string content = Guid.NewGuid().ToString();
Expand Down Expand Up @@ -726,6 +731,7 @@ await LoopbackServer.CreateClientAndServerAsync(
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)]
public async Task ReadAsByteArrayAsync_Unbuffered_CanBeCanceled_AlreadyCanceledCts()
{
await LoopbackServer.CreateClientAndServerAsync(
Expand Down Expand Up @@ -753,6 +759,7 @@ await LoopbackServer.CreateClientAndServerAsync(
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)]
public async Task ReadAsByteArrayAsync_Unbuffered_CanBeCanceled()
{
var cts = new CancellationTokenSource();
Expand Down Expand Up @@ -789,6 +796,7 @@ await server.AcceptConnectionAsync(async connection =>
[Theory]
[InlineData(true)]
[InlineData(false)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)]
public async Task ReadAsStreamAsync_Buffered_IgnoresCancellationToken(bool readStreamAsync)
{
string content = Guid.NewGuid().ToString();
Expand Down Expand Up @@ -820,6 +828,7 @@ await LoopbackServer.CreateClientAndServerAsync(
[Theory]
[InlineData(true)]
[InlineData(false)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)]
public async Task ReadAsStreamAsync_Unbuffered_IgnoresCancellationToken(bool readStreamAsync)
{
string content = Guid.NewGuid().ToString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

namespace System.Net.Http.Functional.Tests
{
[ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))]
public class HttpRequestMessageTest : HttpClientHandlerTestBase
{
private readonly Version _expectedRequestMessageVersion = HttpVersion.Version11;
Expand Down
Loading

0 comments on commit 921db35

Please sign in to comment.