From db84dd4e95fc65f37cf8523f65c21fc54a8c94bd Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Tue, 29 Sep 2020 16:58:58 -0400 Subject: [PATCH 1/3] [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` --- .../HttpClientHandlerTest.Authentication.cs | 10 +++++ .../HttpClientHandlerTest.Decompression.cs | 3 ++ .../tests/FunctionalTests/HPackTest.cs | 1 + .../HttpClientHandlerTest.Http1.cs | 1 + .../tests/FunctionalTests/HttpClientTest.cs | 14 +++++++ .../FunctionalTests/HttpConnectionKeyTest.cs | 1 + .../tests/FunctionalTests/HttpContentTest.cs | 9 +++++ .../FunctionalTests/HttpRequestMessageTest.cs | 1 + .../FunctionalTests/SocketsHttpHandlerTest.cs | 39 +++++++++++++++++++ .../FunctionalTests/SyncHttpHandlerTest.cs | 13 +++++++ 10 files changed, 92 insertions(+) diff --git a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Authentication.cs b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Authentication.cs index a5a6ea002efe7..b17ca7be3e725 100644 --- a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Authentication.cs +++ b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Authentication.cs @@ -98,6 +98,7 @@ public static IEnumerable Authentication_SocketsHttpHandler_TestData() [Theory] [MemberData(nameof(Authentication_TestData))] + [SkipOnMono("System.Net.Sockets is not supported on this platform", TestPlatforms.Browser)] public async Task HttpClientHandler_Authentication_Succeeds(string authenticateHeader, bool result) { if (PlatformDetection.IsWindowsNanoServer) @@ -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")] + [SkipOnMono("System.Net.Sockets is not supported on this platform", TestPlatforms.Browser)] public async Task HttpClientHandler_MultipleAuthenticateHeaders_Succeeds(string authenticateHeader) { if (PlatformDetection.IsWindowsNanoServer) @@ -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")] + [SkipOnMono("System.Net.Sockets is not supported on this platform", TestPlatforms.Browser)] public async Task HttpClientHandler_MultipleAuthenticateHeaders_PicksSupported(string authenticateHeader, string supportedAuth, string unsupportedAuth) { if (PlatformDetection.IsWindowsNanoServer) @@ -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")] + [SkipOnMono("System.Net.Sockets is not supported on this platform", TestPlatforms.Browser)] public async Task HttpClientHandler_IncorrectCredentials_Fails(string authenticateHeader) { var options = new LoopbackServer.Options { Domain = Domain, Username = Username, Password = Password }; @@ -218,6 +222,7 @@ public static IEnumerable Authentication_TestData() [InlineData("NTLM")] [InlineData("Kerberos")] [InlineData("Negotiate")] + [SkipOnMono("System.Net.Sockets is not supported on this platform", TestPlatforms.Browser)] public async Task PreAuthenticate_NoPreviousAuthenticatedRequests_NoCredentialsSent(string credCacheScheme) { const int NumRequests = 3; @@ -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")] + [SkipOnMono("System.Net.Sockets is not supported on this platform", TestPlatforms.Browser)] public async Task PreAuthenticate_FirstRequestNoHeaderAndAuthenticates_SecondRequestPreauthenticates(string credCacheScheme, string authResponse) { await LoopbackServer.CreateClientAndServerAsync(async uri => @@ -352,6 +358,7 @@ await LoopbackServer.CreateClientAndServerAsync(async uri => [InlineData((HttpStatusCode)508)] // LoopDetected [InlineData((HttpStatusCode)510)] // NotExtended [InlineData((HttpStatusCode)511)] // NetworkAuthenticationRequired + [SkipOnMono("System.Net.Sockets is not supported on this platform", TestPlatforms.Browser)] public async Task PreAuthenticate_FirstRequestNoHeader_SecondRequestVariousStatusCodes_ThirdRequestPreauthenticates(HttpStatusCode statusCode) { const string AuthResponse = "WWW-Authenticate: Basic realm=\"hello\"\r\n"; @@ -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)] + [SkipOnMono("System.Net.Sockets is not supported on this platform", TestPlatforms.Browser)] public async Task PreAuthenticate_AuthenticatedUrl_ThenTryDifferentUrl_SendsAuthHeaderOnlyIfPrefixMatches( string originalRelativeUri, string secondRelativeUri, bool expectedAuthHeader) { @@ -434,6 +442,7 @@ await LoopbackServer.CreateClientAndServerAsync(async uri => } [Fact] + [SkipOnMono("System.Net.Sockets is not supported on this platform", TestPlatforms.Browser)] public async Task PreAuthenticate_SuccessfulBasicButThenFails_DoesntLoopInfinitely() { await LoopbackServer.CreateClientAndServerAsync(async uri => @@ -472,6 +481,7 @@ await LoopbackServer.CreateClientAndServerAsync(async uri => } [Fact] + [SkipOnMono("System.Net.Sockets is not supported on this platform", TestPlatforms.Browser)] public async Task PreAuthenticate_SuccessfulBasic_ThenDigestChallenged() { if (IsWinHttpHandler) diff --git a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Decompression.cs b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Decompression.cs index 676845aa4ba97..7f508ce460825 100644 --- a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Decompression.cs +++ b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Decompression.cs @@ -46,6 +46,7 @@ public static IEnumerable 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 compress; @@ -135,6 +136,7 @@ public static IEnumerable DecompressedResponse_MethodNotSpecified_Orig [Theory] [MemberData(nameof(DecompressedResponse_MethodNotSpecified_OriginalContentReturned_MemberData))] + [SkipOnMono("System.Net.Sockets is not supported on this platform", TestPlatforms.Browser)] public async Task DecompressedResponse_MethodNotSpecified_OriginalContentReturned( string encodingName, Func compress, DecompressionMethods methods) { @@ -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")] + [SkipOnMono("System.Net.Sockets is not supported on this platform", TestPlatforms.Browser)] public async Task GetAsync_SetAutomaticDecompression_AcceptEncodingHeaderSentWithNoDuplicates( DecompressionMethods methods, string encodings, diff --git a/src/libraries/System.Net.Http/tests/FunctionalTests/HPackTest.cs b/src/libraries/System.Net.Http/tests/FunctionalTests/HPackTest.cs index 784f67a1271f3..c1a4cdb314c3f 100644 --- a/src/libraries/System.Net.Http/tests/FunctionalTests/HPackTest.cs +++ b/src/libraries/System.Net.Http/tests/FunctionalTests/HPackTest.cs @@ -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; diff --git a/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.Http1.cs b/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.Http1.cs index f0e58b32ca345..62e0d3d9c9147 100644 --- a/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.Http1.cs +++ b/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.Http1.cs @@ -12,6 +12,7 @@ namespace System.Net.Http.Functional.Tests { // This class is dedicated to SocketHttpHandler tests specific to HTTP/1.x. + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] public class HttpClientHandlerTest_Http1 : HttpClientHandlerTestBase { public HttpClientHandlerTest_Http1(ITestOutputHelper output) : base(output) { } diff --git a/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientTest.cs b/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientTest.cs index 4cadad06b0d2e..d39028e021aea 100644 --- a/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientTest.cs +++ b/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientTest.cs @@ -349,6 +349,7 @@ public async Task GetAsync_CustomException_Asynchronous_ThrowsException() } [Fact] + [SkipOnMono("System.Net.Sockets is not supported on this platform", TestPlatforms.Browser)] public async Task GetStringAsync_Success() { string content = Guid.NewGuid().ToString(); @@ -368,6 +369,7 @@ await LoopbackServer.CreateClientAndServerAsync( } [Fact] + [SkipOnMono("System.Net.Sockets is not supported on this platform", TestPlatforms.Browser)] public async Task GetStringAsync_CanBeCanceled_AlreadyCanceledCts() { var onClientFinished = new SemaphoreSlim(0, 1); @@ -390,6 +392,7 @@ await LoopbackServer.CreateClientAndServerAsync( } [Fact] + [SkipOnMono("System.Net.Sockets is not supported on this platform", TestPlatforms.Browser)] public async Task GetStringAsync_CanBeCanceled() { var cts = new CancellationTokenSource(); @@ -503,6 +506,7 @@ await server.AcceptConnectionAsync(async connection => } [Fact] + [SkipOnMono("System.Net.Sockets is not supported on this platform", TestPlatforms.Browser)] public async Task GetByteArrayAsync_Success() { string content = Guid.NewGuid().ToString(); @@ -523,6 +527,7 @@ await LoopbackServer.CreateClientAndServerAsync( } [Fact] + [SkipOnMono("System.Net.Sockets is not supported on this platform", TestPlatforms.Browser)] public async Task GetByteArrayAsync_CanBeCanceled_AlreadyCanceledCts() { var onClientFinished = new SemaphoreSlim(0, 1); @@ -545,6 +550,7 @@ await LoopbackServer.CreateClientAndServerAsync( } [Fact] + [SkipOnMono("System.Net.Sockets is not supported on this platform", TestPlatforms.Browser)] public async Task GetByteArrayAsync_CanBeCanceled() { var cts = new CancellationTokenSource(); @@ -571,6 +577,7 @@ await server.AcceptConnectionAsync(async connection => } [Fact] + [SkipOnMono("System.Net.Sockets is not supported on this platform", TestPlatforms.Browser)] public async Task GetStreamAsync_Success() { string content = Guid.NewGuid().ToString(); @@ -594,6 +601,7 @@ await LoopbackServer.CreateClientAndServerAsync( } [Fact] + [SkipOnMono("System.Net.Sockets is not supported on this platform", TestPlatforms.Browser)] public async Task GetStreamAsync_CanBeCanceled_AlreadyCanceledCts() { var onClientFinished = new SemaphoreSlim(0, 1); @@ -616,6 +624,7 @@ await LoopbackServer.CreateClientAndServerAsync( } [Fact] + [SkipOnMono("System.Net.Sockets is not supported on this platform", TestPlatforms.Browser)] public async Task GetStreamAsync_CanBeCanceled() { var cts = new CancellationTokenSource(); @@ -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(c)))) @@ -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(c)))) @@ -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(c)))) @@ -867,6 +879,7 @@ public void Send_SingleThread_Succeeds(HttpCompletionOption completionOption) [Theory] [InlineData(HttpCompletionOption.ResponseContentRead)] [InlineData(HttpCompletionOption.ResponseHeadersRead)] + [SkipOnMono("System.Net.Sockets is not supported on this platform", TestPlatforms.Browser)] public async Task Send_SingleThread_Loopback_Succeeds(HttpCompletionOption completionOption) { string content = "Test content"; @@ -1141,6 +1154,7 @@ public static IEnumerable VersionSelectionMemberData() [Theory] [MemberData(nameof(VersionSelectionMemberData))] + [SkipOnMono("System.Net.Sockets is not supported on this platform", TestPlatforms.Browser)] public async Task SendAsync_CorrectVersionSelected_LoopbackServer(Version requestVersion, HttpVersionPolicy versionPolicy, Version serverVersion, bool useSsl, object expectedResult) { await HttpAgnosticLoopbackServer.CreateClientAndServerAsync( diff --git a/src/libraries/System.Net.Http/tests/FunctionalTests/HttpConnectionKeyTest.cs b/src/libraries/System.Net.Http/tests/FunctionalTests/HttpConnectionKeyTest.cs index af4cc7601f21b..1177b6bb06b90 100644 --- a/src/libraries/System.Net.Http/tests/FunctionalTests/HttpConnectionKeyTest.cs +++ b/src/libraries/System.Net.Http/tests/FunctionalTests/HttpConnectionKeyTest.cs @@ -9,6 +9,7 @@ namespace System.Net.Http.Functional.Tests { + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] public class HttpConnectionKeyTest { public static IEnumerable KeyComponents() diff --git a/src/libraries/System.Net.Http/tests/FunctionalTests/HttpContentTest.cs b/src/libraries/System.Net.Http/tests/FunctionalTests/HttpContentTest.cs index 5f37b881feae6..4d074430ceb73 100644 --- a/src/libraries/System.Net.Http/tests/FunctionalTests/HttpContentTest.cs +++ b/src/libraries/System.Net.Http/tests/FunctionalTests/HttpContentTest.cs @@ -298,6 +298,7 @@ public async Task ReadAsStreamAsync_FirstGetFromUnbufferedContentThenGetFromBuff Assert.Equal(before, after); } + [SkipOnMono("System.Net.Sockets is not supported on this platform", TestPlatforms.Browser)] [Theory] [InlineData(true)] [InlineData(false)] @@ -612,6 +613,7 @@ public void Dispose_DisposedObjectThenAccessMembers_ThrowsObjectDisposedExceptio [Fact] + [SkipOnMono("System.Net.Sockets is not supported on this platform", TestPlatforms.Browser)] public async Task ReadAsStringAsync_Buffered_IgnoresCancellationToken() { string content = Guid.NewGuid().ToString(); @@ -638,6 +640,7 @@ await LoopbackServer.CreateClientAndServerAsync( } [Fact] + [SkipOnMono("System.Net.Sockets is not supported on this platform", TestPlatforms.Browser)] public async Task ReadAsStringAsync_Unbuffered_CanBeCanceled_AlreadyCanceledCts() { await LoopbackServer.CreateClientAndServerAsync( @@ -665,6 +668,7 @@ await LoopbackServer.CreateClientAndServerAsync( } [Fact] + [SkipOnMono("System.Net.Sockets is not supported on this platform", TestPlatforms.Browser)] public async Task ReadAsStringAsync_Unbuffered_CanBeCanceled() { var cts = new CancellationTokenSource(); @@ -699,6 +703,7 @@ await server.AcceptConnectionAsync(async connection => } [Fact] + [SkipOnMono("System.Net.Sockets is not supported on this platform", TestPlatforms.Browser)] public async Task ReadAsByteArrayAsync_Buffered_IgnoresCancellationToken() { string content = Guid.NewGuid().ToString(); @@ -726,6 +731,7 @@ await LoopbackServer.CreateClientAndServerAsync( } [Fact] + [SkipOnMono("System.Net.Sockets is not supported on this platform", TestPlatforms.Browser)] public async Task ReadAsByteArrayAsync_Unbuffered_CanBeCanceled_AlreadyCanceledCts() { await LoopbackServer.CreateClientAndServerAsync( @@ -753,6 +759,7 @@ await LoopbackServer.CreateClientAndServerAsync( } [Fact] + [SkipOnMono("System.Net.Sockets is not supported on this platform", TestPlatforms.Browser)] public async Task ReadAsByteArrayAsync_Unbuffered_CanBeCanceled() { var cts = new CancellationTokenSource(); @@ -789,6 +796,7 @@ await server.AcceptConnectionAsync(async connection => [Theory] [InlineData(true)] [InlineData(false)] + [SkipOnMono("System.Net.Sockets is not supported on this platform", TestPlatforms.Browser)] public async Task ReadAsStreamAsync_Buffered_IgnoresCancellationToken(bool readStreamAsync) { string content = Guid.NewGuid().ToString(); @@ -820,6 +828,7 @@ await LoopbackServer.CreateClientAndServerAsync( [Theory] [InlineData(true)] [InlineData(false)] + [SkipOnMono("System.Net.Sockets is not supported on this platform", TestPlatforms.Browser)] public async Task ReadAsStreamAsync_Unbuffered_IgnoresCancellationToken(bool readStreamAsync) { string content = Guid.NewGuid().ToString(); diff --git a/src/libraries/System.Net.Http/tests/FunctionalTests/HttpRequestMessageTest.cs b/src/libraries/System.Net.Http/tests/FunctionalTests/HttpRequestMessageTest.cs index 8f5ff80d998d2..2929a612e79d7 100644 --- a/src/libraries/System.Net.Http/tests/FunctionalTests/HttpRequestMessageTest.cs +++ b/src/libraries/System.Net.Http/tests/FunctionalTests/HttpRequestMessageTest.cs @@ -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; diff --git a/src/libraries/System.Net.Http/tests/FunctionalTests/SocketsHttpHandlerTest.cs b/src/libraries/System.Net.Http/tests/FunctionalTests/SocketsHttpHandlerTest.cs index 80432a5da8c28..adec4c1a98dfc 100644 --- a/src/libraries/System.Net.Http/tests/FunctionalTests/SocketsHttpHandlerTest.cs +++ b/src/libraries/System.Net.Http/tests/FunctionalTests/SocketsHttpHandlerTest.cs @@ -23,6 +23,7 @@ namespace System.Net.Http.Functional.Tests { + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] public sealed class SocketsHttpHandler_HttpClientHandler_Asynchrony_Test : HttpClientHandler_Asynchrony_Test { public SocketsHttpHandler_HttpClientHandler_Asynchrony_Test(ITestOutputHelper output) : base(output) { } @@ -107,11 +108,13 @@ private sealed class SetOnFinalized } } + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] public sealed class SocketsHttpHandler_HttpProtocolTests : HttpProtocolTests { public SocketsHttpHandler_HttpProtocolTests(ITestOutputHelper output) : base(output) { } } + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] public sealed class SocketsHttpHandler_HttpProtocolTests_Dribble : HttpProtocolTests_Dribble { public SocketsHttpHandler_HttpProtocolTests_Dribble(ITestOutputHelper output) : base(output) { } @@ -139,16 +142,19 @@ public sealed class SocketsHttpHandler_HttpClientHandler_Decompression_Tests : H public SocketsHttpHandler_HttpClientHandler_Decompression_Tests(ITestOutputHelper output) : base(output) { } } + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] public sealed class SocketsHttpHandler_HttpClientHandler_DangerousAcceptAllCertificatesValidator_Test : HttpClientHandler_DangerousAcceptAllCertificatesValidator_Test { public SocketsHttpHandler_HttpClientHandler_DangerousAcceptAllCertificatesValidator_Test(ITestOutputHelper output) : base(output) { } } + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] public sealed class SocketsHttpHandler_HttpClientHandler_ClientCertificates_Test : HttpClientHandler_ClientCertificates_Test { public SocketsHttpHandler_HttpClientHandler_ClientCertificates_Test(ITestOutputHelper output) : base(output) { } } + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] public sealed class SocketsHttpHandler_HttpClientHandler_DefaultProxyCredentials_Test : HttpClientHandler_DefaultProxyCredentials_Test { public SocketsHttpHandler_HttpClientHandler_DefaultProxyCredentials_Test(ITestOutputHelper output) : base(output) { } @@ -165,6 +171,8 @@ public SocketsHttpHandler_HttpClientHandler_Finalization_Http2_Test(ITestOutputH protected override Version UseVersion => HttpVersion.Version20; } + // set_MaxConnectionsPerServer - System.PlatformNotSupportedException + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] public sealed class SocketsHttpHandler_HttpClientHandler_MaxConnectionsPerServer_Test : HttpClientHandler_MaxConnectionsPerServer_Test { public SocketsHttpHandler_HttpClientHandler_MaxConnectionsPerServer_Test(ITestOutputHelper output) : base(output) { } @@ -213,11 +221,13 @@ await server.AcceptConnectionAsync(async connection => } } + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] public sealed class SocketsHttpHandler_HttpClientHandler_ServerCertificates_Test : HttpClientHandler_ServerCertificates_Test { public SocketsHttpHandler_HttpClientHandler_ServerCertificates_Test(ITestOutputHelper output) : base(output) { } } + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] public sealed class SocketsHttpHandler_HttpClientHandler_ResponseDrain_Test : HttpClientHandler_ResponseDrain_Test { protected override void SetResponseDrainTimeout(HttpClientHandler handler, TimeSpan time) @@ -461,6 +471,7 @@ await server.AcceptConnectionAsync(async connection => } } + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] public sealed class SocketsHttpHandler_PostScenarioTest : PostScenarioTest { public SocketsHttpHandler_PostScenarioTest(ITestOutputHelper output) : base(output) { } @@ -516,16 +527,19 @@ protected override bool TryComputeLength(out long length) } } + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] public sealed class SocketsHttpHandler_ResponseStreamTest : ResponseStreamTest { public SocketsHttpHandler_ResponseStreamTest(ITestOutputHelper output) : base(output) { } } + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] public sealed class SocketsHttpHandler_HttpClientHandler_SslProtocols_Test : HttpClientHandler_SslProtocols_Test { public SocketsHttpHandler_HttpClientHandler_SslProtocols_Test(ITestOutputHelper output) : base(output) { } } + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] public sealed class SocketsHttpHandler_HttpClientHandler_Proxy_Test : HttpClientHandler_Proxy_Test { public SocketsHttpHandler_HttpClientHandler_Proxy_Test(ITestOutputHelper output) : base(output) { } @@ -547,6 +561,8 @@ protected static Frame MakeDataFrame(int streamId, byte[] data, bool endStream = new DataFrame(data, (endStream ? FrameFlags.EndStream : FrameFlags.None), 0, streamId); } + // System.Net.Sockets is not supported on this platform + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] public class SocketsHttpHandler_Http1_TrailingHeaders_Test : SocketsHttpHandler_TrailingHeaders_Test { public SocketsHttpHandler_Http1_TrailingHeaders_Test(ITestOutputHelper output) : base(output) { } @@ -950,6 +966,7 @@ public sealed class SocketsHttpHandler_HttpClientHandlerTest : HttpClientHandler public SocketsHttpHandler_HttpClientHandlerTest(ITestOutputHelper output) : base(output) { } } + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] public sealed class SocketsHttpHandlerTest_AutoRedirect : HttpClientHandlerTest_AutoRedirect { public SocketsHttpHandlerTest_AutoRedirect(ITestOutputHelper output) : base(output) { } @@ -960,27 +977,32 @@ public sealed class SocketsHttpHandler_DefaultCredentialsTest : DefaultCredentia public SocketsHttpHandler_DefaultCredentialsTest(ITestOutputHelper output) : base(output) { } } + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] public sealed class SocketsHttpHandler_IdnaProtocolTests : IdnaProtocolTests { public SocketsHttpHandler_IdnaProtocolTests(ITestOutputHelper output) : base(output) { } protected override bool SupportsIdna => true; } + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] public sealed class SocketsHttpHandler_HttpRetryProtocolTests : HttpRetryProtocolTests { public SocketsHttpHandler_HttpRetryProtocolTests(ITestOutputHelper output) : base(output) { } } + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] public sealed class SocketsHttpHandlerTest_Cookies : HttpClientHandlerTest_Cookies { public SocketsHttpHandlerTest_Cookies(ITestOutputHelper output) : base(output) { } } + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] public sealed class SocketsHttpHandlerTest_Cookies_Http11 : HttpClientHandlerTest_Cookies_Http11 { public SocketsHttpHandlerTest_Cookies_Http11(ITestOutputHelper output) : base(output) { } } + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] public sealed class SocketsHttpHandler_HttpClientHandler_Cancellation_Test : HttpClientHandler_Http11_Cancellation_Test { public SocketsHttpHandler_HttpClientHandler_Cancellation_Test(ITestOutputHelper output) : base(output) { } @@ -1081,16 +1103,21 @@ public void Expect100ContinueTimeout_SetAfterUse_Throws() } } + // BrowserHttpHandler.set_MaxResponseHeadersLength - Not supported on this platform + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] public sealed class SocketsHttpHandler_HttpClientHandler_MaxResponseHeadersLength_Test : HttpClientHandler_MaxResponseHeadersLength_Test { public SocketsHttpHandler_HttpClientHandler_MaxResponseHeadersLength_Test(ITestOutputHelper output) : base(output) { } } + //System.Net.Sockets is not supported on this platform + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] public sealed class SocketsHttpHandler_HttpClientHandler_Authentication_Test : HttpClientHandler_Authentication_Test { public SocketsHttpHandler_HttpClientHandler_Authentication_Test(ITestOutputHelper output) : base(output) { } } + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] public sealed class SocketsHttpHandler_ConnectionUpgrade_Test : HttpClientHandlerTestBase { public SocketsHttpHandler_ConnectionUpgrade_Test(ITestOutputHelper output) : base(output) { } @@ -1210,11 +1237,14 @@ await server.AcceptConnectionAsync(async connection => } } + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] public sealed class SocketsHttpHandler_Connect_Test : HttpClientHandler_Connect_Test { public SocketsHttpHandler_Connect_Test(ITestOutputHelper output) : base(output) { } } + // System.Net.Sockets is not supported on this platform + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] public sealed class SocketsHttpHandler_HttpClientHandler_ConnectionPooling_Test : HttpClientHandlerTestBase { public SocketsHttpHandler_HttpClientHandler_ConnectionPooling_Test(ITestOutputHelper output) : base(output) { } @@ -1548,6 +1578,8 @@ await proxyServer.AcceptConnectionAsync(async connection => } } + // System.Net.Sockets is not supported on this platform + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] public sealed class SocketsHttpHandler_PublicAPIBehavior_Test { [Fact] @@ -1938,6 +1970,8 @@ await Assert.ThrowsAnyAsync(() => } } + // System.Net.Sockets is not supported on this platform + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] public sealed class SocketsHttpHandlerTest_LocationHeader { private static readonly byte[] s_redirectResponseBefore = Encoding.ASCII.GetBytes( @@ -1992,6 +2026,7 @@ private static byte[] PreperateResponseWithRedirect(byte[] location) } } + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] public sealed class SocketsHttpHandlerTest_Http2 : HttpClientHandlerTest_Http2 { public SocketsHttpHandlerTest_Http2(ITestOutputHelper output) : base(output) { } @@ -2564,6 +2599,8 @@ public async Task ConnectCallback_ReturnsNull_ThrowsHttpRequestException(bool us private static bool PlatformSupportsUnixDomainSockets => Socket.OSSupportsUnixDomainSockets; } + // System.Net.Sockets is not supported on this platform + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] public sealed class SocketsHttpHandlerTest_ConnectCallback_Http11 : SocketsHttpHandlerTest_ConnectCallback { public SocketsHttpHandlerTest_ConnectCallback_Http11(ITestOutputHelper output) : base(output) { } @@ -2820,6 +2857,7 @@ await LoopbackServerFactory.CreateClientAndServerAsync( } } + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] public sealed class SocketsHttpHandlerTest_PlaintextStreamFilter_Http11 : SocketsHttpHandlerTest_PlaintextStreamFilter { public SocketsHttpHandlerTest_PlaintextStreamFilter_Http11(ITestOutputHelper output) : base(output) { } @@ -2942,6 +2980,7 @@ public SocketsHttpHandlerTest_HttpClientHandlerTest_Http2(ITestOutputHelper outp protected override Version UseVersion => HttpVersion.Version20; } + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] public sealed class SocketsHttpHandlerTest_HttpClientHandlerTest_Headers_Http11 : HttpClientHandlerTest_Headers { public SocketsHttpHandlerTest_HttpClientHandlerTest_Headers_Http11(ITestOutputHelper output) : base(output) { } diff --git a/src/libraries/System.Net.Http/tests/FunctionalTests/SyncHttpHandlerTest.cs b/src/libraries/System.Net.Http/tests/FunctionalTests/SyncHttpHandlerTest.cs index 7ecfee6a16232..98a3493264e59 100644 --- a/src/libraries/System.Net.Http/tests/FunctionalTests/SyncHttpHandlerTest.cs +++ b/src/libraries/System.Net.Http/tests/FunctionalTests/SyncHttpHandlerTest.cs @@ -1,16 +1,19 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using Xunit; using Xunit.Abstractions; namespace System.Net.Http.Functional.Tests { + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] public sealed class SyncHttpHandler_HttpProtocolTests : HttpProtocolTests { public SyncHttpHandler_HttpProtocolTests(ITestOutputHelper output) : base(output) { } protected override bool TestAsync => false; } + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] public sealed class SyncHttpHandler_HttpProtocolTests_Dribble : HttpProtocolTests_Dribble { public SyncHttpHandler_HttpProtocolTests_Dribble(ITestOutputHelper output) : base(output) { } @@ -29,12 +32,14 @@ public SyncHttpHandler_PostScenarioTest(ITestOutputHelper output) : base(output) protected override bool TestAsync => false; } + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] public sealed class SyncHttpHandler_HttpClientHandlerTest : HttpClientHandlerTest { public SyncHttpHandler_HttpClientHandlerTest(ITestOutputHelper output) : base(output) { } protected override bool TestAsync => false; } + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] public sealed class SyncHttpHandlerTest_AutoRedirect : HttpClientHandlerTest_AutoRedirect { public SyncHttpHandlerTest_AutoRedirect(ITestOutputHelper output) : base(output) { } @@ -47,6 +52,7 @@ public SyncHttpHandler_HttpClientHandler_Decompression_Tests(ITestOutputHelper o protected override bool TestAsync => false; } + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] public sealed class SyncHttpHandler_IdnaProtocolTests : IdnaProtocolTests { public SyncHttpHandler_IdnaProtocolTests(ITestOutputHelper output) : base(output) { } @@ -54,42 +60,49 @@ public SyncHttpHandler_IdnaProtocolTests(ITestOutputHelper output) : base(output protected override bool SupportsIdna => true; } + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] public sealed class SyncHttpHandler_HttpRetryProtocolTests : HttpRetryProtocolTests { public SyncHttpHandler_HttpRetryProtocolTests(ITestOutputHelper output) : base(output) { } protected override bool TestAsync => false; } + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] public sealed class SyncHttpHandlerTest_Cookies : HttpClientHandlerTest_Cookies { public SyncHttpHandlerTest_Cookies(ITestOutputHelper output) : base(output) { } protected override bool TestAsync => false; } + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] public sealed class SyncHttpHandlerTest_Cookies_Http11 : HttpClientHandlerTest_Cookies_Http11 { public SyncHttpHandlerTest_Cookies_Http11(ITestOutputHelper output) : base(output) { } protected override bool TestAsync => false; } + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] public sealed class SyncHttpHandler_HttpClientHandler_Cancellation_Test : HttpClientHandler_Http11_Cancellation_Test { public SyncHttpHandler_HttpClientHandler_Cancellation_Test(ITestOutputHelper output) : base(output) { } protected override bool TestAsync => false; } + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] public sealed class SyncHttpHandler_HttpClientHandler_Authentication_Test : HttpClientHandler_Authentication_Test { public SyncHttpHandler_HttpClientHandler_Authentication_Test(ITestOutputHelper output) : base(output) { } protected override bool TestAsync => false; } + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] public sealed class SyncHttpHandler_Connect_Test : HttpClientHandler_Connect_Test { public SyncHttpHandler_Connect_Test(ITestOutputHelper output) : base(output) { } protected override bool TestAsync => false; } + [SkipOnMono("System.Net.Sockets is not supported on this platform.", TestPlatforms.Browser)] public sealed class SyncHttpHandlerTest_HttpClientHandlerTest_Headers : HttpClientHandlerTest_Headers { public SyncHttpHandlerTest_HttpClientHandlerTest_Headers(ITestOutputHelper output) : base(output) { } From c179ddab50be8c7269cb6392d4231bc8651234f1 Mon Sep 17 00:00:00 2001 From: Larry Ewing Date: Tue, 29 Sep 2020 17:23:24 -0500 Subject: [PATCH 2/3] Mark LoopbackServer issues with active issue --- .../HttpClientHandlerTest.Authentication.cs | 20 ++++++++--------- .../HttpClientHandlerTest.Decompression.cs | 4 ++-- .../HttpClientHandlerTest.Http1.cs | 2 +- .../tests/FunctionalTests/HttpClientTest.cs | 22 +++++++++---------- .../tests/FunctionalTests/HttpContentTest.cs | 18 +++++++-------- 5 files changed, 33 insertions(+), 33 deletions(-) diff --git a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Authentication.cs b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Authentication.cs index b17ca7be3e725..3dd6e7ed9ba7a 100644 --- a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Authentication.cs +++ b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Authentication.cs @@ -98,7 +98,7 @@ public static IEnumerable Authentication_SocketsHttpHandler_TestData() [Theory] [MemberData(nameof(Authentication_TestData))] - [SkipOnMono("System.Net.Sockets is not supported on this platform", TestPlatforms.Browser)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)] public async Task HttpClientHandler_Authentication_Succeeds(string authenticateHeader, bool result) { if (PlatformDetection.IsWindowsNanoServer) @@ -138,7 +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")] - [SkipOnMono("System.Net.Sockets is not supported on this platform", TestPlatforms.Browser)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)] public async Task HttpClientHandler_MultipleAuthenticateHeaders_Succeeds(string authenticateHeader) { if (PlatformDetection.IsWindowsNanoServer) @@ -158,7 +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")] - [SkipOnMono("System.Net.Sockets is not supported on this platform", TestPlatforms.Browser)] + [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) @@ -184,7 +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")] - [SkipOnMono("System.Net.Sockets is not supported on this platform", TestPlatforms.Browser)] + [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 }; @@ -222,7 +222,7 @@ public static IEnumerable Authentication_TestData() [InlineData("NTLM")] [InlineData("Kerberos")] [InlineData("Negotiate")] - [SkipOnMono("System.Net.Sockets is not supported on this platform", TestPlatforms.Browser)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)] public async Task PreAuthenticate_NoPreviousAuthenticatedRequests_NoCredentialsSent(string credCacheScheme) { const int NumRequests = 3; @@ -265,7 +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")] - [SkipOnMono("System.Net.Sockets is not supported on this platform", TestPlatforms.Browser)] + [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 => @@ -358,7 +358,7 @@ await LoopbackServer.CreateClientAndServerAsync(async uri => [InlineData((HttpStatusCode)508)] // LoopDetected [InlineData((HttpStatusCode)510)] // NotExtended [InlineData((HttpStatusCode)511)] // NetworkAuthenticationRequired - [SkipOnMono("System.Net.Sockets is not supported on this platform", TestPlatforms.Browser)] + [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"; @@ -402,7 +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)] - [SkipOnMono("System.Net.Sockets is not supported on this platform", TestPlatforms.Browser)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)] public async Task PreAuthenticate_AuthenticatedUrl_ThenTryDifferentUrl_SendsAuthHeaderOnlyIfPrefixMatches( string originalRelativeUri, string secondRelativeUri, bool expectedAuthHeader) { @@ -442,7 +442,7 @@ await LoopbackServer.CreateClientAndServerAsync(async uri => } [Fact] - [SkipOnMono("System.Net.Sockets is not supported on this platform", TestPlatforms.Browser)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)] public async Task PreAuthenticate_SuccessfulBasicButThenFails_DoesntLoopInfinitely() { await LoopbackServer.CreateClientAndServerAsync(async uri => @@ -481,7 +481,7 @@ await LoopbackServer.CreateClientAndServerAsync(async uri => } [Fact] - [SkipOnMono("System.Net.Sockets is not supported on this platform", TestPlatforms.Browser)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)] public async Task PreAuthenticate_SuccessfulBasic_ThenDigestChallenged() { if (IsWinHttpHandler) diff --git a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Decompression.cs b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Decompression.cs index 7f508ce460825..2eac41622bfdc 100644 --- a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Decompression.cs +++ b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Decompression.cs @@ -136,7 +136,7 @@ public static IEnumerable DecompressedResponse_MethodNotSpecified_Orig [Theory] [MemberData(nameof(DecompressedResponse_MethodNotSpecified_OriginalContentReturned_MemberData))] - [SkipOnMono("System.Net.Sockets is not supported on this platform", TestPlatforms.Browser)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)] public async Task DecompressedResponse_MethodNotSpecified_OriginalContentReturned( string encodingName, Func compress, DecompressionMethods methods) { @@ -256,7 +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")] - [SkipOnMono("System.Net.Sockets is not supported on this platform", TestPlatforms.Browser)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)] public async Task GetAsync_SetAutomaticDecompression_AcceptEncodingHeaderSentWithNoDuplicates( DecompressionMethods methods, string encodings, diff --git a/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.Http1.cs b/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.Http1.cs index 62e0d3d9c9147..c7579cd114bb2 100644 --- a/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.Http1.cs +++ b/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.Http1.cs @@ -12,12 +12,12 @@ namespace System.Net.Http.Functional.Tests { // This class is dedicated to SocketHttpHandler tests specific to HTTP/1.x. - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] 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 diff --git a/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientTest.cs b/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientTest.cs index d39028e021aea..619725054a24d 100644 --- a/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientTest.cs +++ b/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientTest.cs @@ -349,7 +349,7 @@ public async Task GetAsync_CustomException_Asynchronous_ThrowsException() } [Fact] - [SkipOnMono("System.Net.Sockets is not supported on this platform", TestPlatforms.Browser)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)] public async Task GetStringAsync_Success() { string content = Guid.NewGuid().ToString(); @@ -369,7 +369,7 @@ await LoopbackServer.CreateClientAndServerAsync( } [Fact] - [SkipOnMono("System.Net.Sockets is not supported on this platform", TestPlatforms.Browser)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)] public async Task GetStringAsync_CanBeCanceled_AlreadyCanceledCts() { var onClientFinished = new SemaphoreSlim(0, 1); @@ -392,7 +392,7 @@ await LoopbackServer.CreateClientAndServerAsync( } [Fact] - [SkipOnMono("System.Net.Sockets is not supported on this platform", TestPlatforms.Browser)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)] public async Task GetStringAsync_CanBeCanceled() { var cts = new CancellationTokenSource(); @@ -506,7 +506,7 @@ await server.AcceptConnectionAsync(async connection => } [Fact] - [SkipOnMono("System.Net.Sockets is not supported on this platform", TestPlatforms.Browser)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)] public async Task GetByteArrayAsync_Success() { string content = Guid.NewGuid().ToString(); @@ -527,7 +527,7 @@ await LoopbackServer.CreateClientAndServerAsync( } [Fact] - [SkipOnMono("System.Net.Sockets is not supported on this platform", TestPlatforms.Browser)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)] public async Task GetByteArrayAsync_CanBeCanceled_AlreadyCanceledCts() { var onClientFinished = new SemaphoreSlim(0, 1); @@ -550,7 +550,7 @@ await LoopbackServer.CreateClientAndServerAsync( } [Fact] - [SkipOnMono("System.Net.Sockets is not supported on this platform", TestPlatforms.Browser)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)] public async Task GetByteArrayAsync_CanBeCanceled() { var cts = new CancellationTokenSource(); @@ -577,7 +577,7 @@ await server.AcceptConnectionAsync(async connection => } [Fact] - [SkipOnMono("System.Net.Sockets is not supported on this platform", TestPlatforms.Browser)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)] public async Task GetStreamAsync_Success() { string content = Guid.NewGuid().ToString(); @@ -601,7 +601,7 @@ await LoopbackServer.CreateClientAndServerAsync( } [Fact] - [SkipOnMono("System.Net.Sockets is not supported on this platform", TestPlatforms.Browser)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)] public async Task GetStreamAsync_CanBeCanceled_AlreadyCanceledCts() { var onClientFinished = new SemaphoreSlim(0, 1); @@ -624,7 +624,7 @@ await LoopbackServer.CreateClientAndServerAsync( } [Fact] - [SkipOnMono("System.Net.Sockets is not supported on this platform", TestPlatforms.Browser)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)] public async Task GetStreamAsync_CanBeCanceled() { var cts = new CancellationTokenSource(); @@ -879,7 +879,7 @@ public void Send_SingleThread_Succeeds(HttpCompletionOption completionOption) [Theory] [InlineData(HttpCompletionOption.ResponseContentRead)] [InlineData(HttpCompletionOption.ResponseHeadersRead)] - [SkipOnMono("System.Net.Sockets is not supported on this platform", TestPlatforms.Browser)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)] public async Task Send_SingleThread_Loopback_Succeeds(HttpCompletionOption completionOption) { string content = "Test content"; @@ -1154,7 +1154,7 @@ public static IEnumerable VersionSelectionMemberData() [Theory] [MemberData(nameof(VersionSelectionMemberData))] - [SkipOnMono("System.Net.Sockets is not supported on this platform", TestPlatforms.Browser)] + [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( diff --git a/src/libraries/System.Net.Http/tests/FunctionalTests/HttpContentTest.cs b/src/libraries/System.Net.Http/tests/FunctionalTests/HttpContentTest.cs index 4d074430ceb73..ddd39b89d840e 100644 --- a/src/libraries/System.Net.Http/tests/FunctionalTests/HttpContentTest.cs +++ b/src/libraries/System.Net.Http/tests/FunctionalTests/HttpContentTest.cs @@ -298,7 +298,7 @@ public async Task ReadAsStreamAsync_FirstGetFromUnbufferedContentThenGetFromBuff Assert.Equal(before, after); } - [SkipOnMono("System.Net.Sockets is not supported on this platform", TestPlatforms.Browser)] + [SkipOnMono("Browser doesn't support Synchronous reads", TestPlatforms.Browser)] [Theory] [InlineData(true)] [InlineData(false)] @@ -613,7 +613,7 @@ public void Dispose_DisposedObjectThenAccessMembers_ThrowsObjectDisposedExceptio [Fact] - [SkipOnMono("System.Net.Sockets is not supported on this platform", TestPlatforms.Browser)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)] public async Task ReadAsStringAsync_Buffered_IgnoresCancellationToken() { string content = Guid.NewGuid().ToString(); @@ -640,7 +640,7 @@ await LoopbackServer.CreateClientAndServerAsync( } [Fact] - [SkipOnMono("System.Net.Sockets is not supported on this platform", TestPlatforms.Browser)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)] public async Task ReadAsStringAsync_Unbuffered_CanBeCanceled_AlreadyCanceledCts() { await LoopbackServer.CreateClientAndServerAsync( @@ -668,7 +668,7 @@ await LoopbackServer.CreateClientAndServerAsync( } [Fact] - [SkipOnMono("System.Net.Sockets is not supported on this platform", TestPlatforms.Browser)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)] public async Task ReadAsStringAsync_Unbuffered_CanBeCanceled() { var cts = new CancellationTokenSource(); @@ -703,7 +703,7 @@ await server.AcceptConnectionAsync(async connection => } [Fact] - [SkipOnMono("System.Net.Sockets is not supported on this platform", TestPlatforms.Browser)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)] public async Task ReadAsByteArrayAsync_Buffered_IgnoresCancellationToken() { string content = Guid.NewGuid().ToString(); @@ -731,7 +731,7 @@ await LoopbackServer.CreateClientAndServerAsync( } [Fact] - [SkipOnMono("System.Net.Sockets is not supported on this platform", TestPlatforms.Browser)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)] public async Task ReadAsByteArrayAsync_Unbuffered_CanBeCanceled_AlreadyCanceledCts() { await LoopbackServer.CreateClientAndServerAsync( @@ -759,7 +759,7 @@ await LoopbackServer.CreateClientAndServerAsync( } [Fact] - [SkipOnMono("System.Net.Sockets is not supported on this platform", TestPlatforms.Browser)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)] public async Task ReadAsByteArrayAsync_Unbuffered_CanBeCanceled() { var cts = new CancellationTokenSource(); @@ -796,7 +796,7 @@ await server.AcceptConnectionAsync(async connection => [Theory] [InlineData(true)] [InlineData(false)] - [SkipOnMono("System.Net.Sockets is not supported on this platform", TestPlatforms.Browser)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)] public async Task ReadAsStreamAsync_Buffered_IgnoresCancellationToken(bool readStreamAsync) { string content = Guid.NewGuid().ToString(); @@ -828,7 +828,7 @@ await LoopbackServer.CreateClientAndServerAsync( [Theory] [InlineData(true)] [InlineData(false)] - [SkipOnMono("System.Net.Sockets is not supported on this platform", TestPlatforms.Browser)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)] public async Task ReadAsStreamAsync_Unbuffered_IgnoresCancellationToken(bool readStreamAsync) { string content = Guid.NewGuid().ToString(); From fbd13ef04b7001a2d56b7715ffe8c5dc7bad4776 Mon Sep 17 00:00:00 2001 From: Larry Ewing Date: Thu, 8 Oct 2020 02:11:01 -0500 Subject: [PATCH 3/3] fix the exclusion on browser --- .../System.Net.Http/tests/FunctionalTests/AssemblyInfo.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libraries/System.Net.Http/tests/FunctionalTests/AssemblyInfo.cs b/src/libraries/System.Net.Http/tests/FunctionalTests/AssemblyInfo.cs index 5706d59b8f5c7..c3b2610bde766 100644 --- a/src/libraries/System.Net.Http/tests/FunctionalTests/AssemblyInfo.cs +++ b/src/libraries/System.Net.Http/tests/FunctionalTests/AssemblyInfo.cs @@ -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