From 114532f7ea6e7766bc5ffc43e011ff66432900d4 Mon Sep 17 00:00:00 2001
From: Radek Zikmund <32671551+rzikm@users.noreply.github.com>
Date: Wed, 15 Jan 2025 11:52:05 +0100
Subject: [PATCH] [release/9.0] Disable tests targetting
 http://corefx-net-http11.azurewebsites.net (#111402)

* Disable more tests dependent on http://corefx-net-http11.azurewebsites.net (#111354)

* Disable more tests dependent on http://corefx-net-http11.azurewebsites.net

* Disable winhttphandlertests

* Disable tests using http://corefx-net-http11.azurewebsites.net (#111235)

Disabling until HTTPS redirection can be turned off at the server.
---
 .../tests/System/Net/Configuration.Http.cs    | 39 ++++++++++++++++---
 .../System/Net/Configuration.WebSockets.cs    | 13 +++++--
 .../HttpClientHandlerTest.RemoteServer.cs     | 21 +++++-----
 ...ttpClientHandlerTest.ServerCertificates.cs |  1 +
 .../FunctionalTests/ServerCertificateTest.cs  |  1 +
 .../FunctionalTests/WinHttpHandlerTest.cs     |  2 +-
 .../tests/FunctionalTests/MetricsTest.cs      |  4 +-
 7 files changed, 59 insertions(+), 22 deletions(-)

diff --git a/src/libraries/Common/tests/System/Net/Configuration.Http.cs b/src/libraries/Common/tests/System/Net/Configuration.Http.cs
index f568e54f261d22..f7e6fc759c0dd5 100644
--- a/src/libraries/Common/tests/System/Net/Configuration.Http.cs
+++ b/src/libraries/Common/tests/System/Net/Configuration.Http.cs
@@ -64,9 +64,16 @@ public static Uri[] GetEchoServerList()
                 if (PlatformDetection.IsFirefox)
                 {
                     // https://github.com/dotnet/runtime/issues/101115
-                    return [RemoteEchoServer];
+                    // [ActiveIssue("https://github.com/dotnet/runtime/issues/110578)]
+                    // return [RemoteEchoServer];
+                    return [];
                 }
-                return [RemoteEchoServer, SecureRemoteEchoServer, Http2RemoteEchoServer];
+                return [
+                    // [ActiveIssue("https://github.com/dotnet/runtime/issues/110578)]
+                    // RemoteEchoServer,
+                    SecureRemoteEchoServer,
+                    Http2RemoteEchoServer
+                ];
             }
 
             public static readonly Uri RemoteVerifyUploadServer = new Uri("http://" + Host + "/" + VerifyUploadHandler);
@@ -82,8 +89,20 @@ public static Uri[] GetEchoServerList()
             public static Uri RemoteLoopServer => new Uri("ws://" + RemoteLoopHost + "/" + RemoteLoopHandler);
 
             public static readonly object[][] EchoServers = GetEchoServerList().Select(x => new object[] { x }).ToArray();
-            public static readonly object[][] VerifyUploadServers = { new object[] { RemoteVerifyUploadServer }, new object[] { SecureRemoteVerifyUploadServer }, new object[] { Http2RemoteVerifyUploadServer } };
-            public static readonly object[][] CompressedServers = { new object[] { RemoteDeflateServer }, new object[] { RemoteGZipServer }, new object[] { Http2RemoteDeflateServer }, new object[] { Http2RemoteGZipServer } };
+            public static readonly object[][] VerifyUploadServers = {
+                // [ActiveIssue("https://github.com/dotnet/runtime/issues/110578)]
+                // new object[] { RemoteVerifyUploadServer },
+                new object[] { SecureRemoteVerifyUploadServer },
+                new object[] { Http2RemoteVerifyUploadServer }
+            };
+
+            public static readonly object[][] CompressedServers = {
+                // [ActiveIssue("https://github.com/dotnet/runtime/issues/110578)]
+                // new object[] { RemoteDeflateServer },
+                new object[] { RemoteGZipServer },
+                new object[] { Http2RemoteDeflateServer },
+                new object[] { Http2RemoteGZipServer }
+            };
 
             public static readonly object[][] Http2Servers = { new object[] { new Uri("https://" + Http2Host) } };
             public static readonly object[][] Http2NoPushServers = { new object[] { new Uri("https://" + Http2NoPushHost) } };
@@ -97,9 +116,17 @@ public static IEnumerable<RemoteServer> GetRemoteServers()
                 if (PlatformDetection.IsFirefox)
                 {
                     // https://github.com/dotnet/runtime/issues/101115
-                    return new RemoteServer[] { RemoteHttp11Server };
+                    // [ActiveIssue("https://github.com/dotnet/runtime/issues/110578)]
+                    // return new RemoteServer[] { RemoteHttp11Server };
+                    return [];
                 }
-                return new RemoteServer[] { RemoteHttp11Server, RemoteSecureHttp11Server, RemoteHttp2Server };
+                return new RemoteServer[]
+                {
+                    // [ActiveIssue("https://github.com/dotnet/runtime/issues/110578)]
+                    // RemoteHttp11Server,
+                    RemoteSecureHttp11Server,
+                    RemoteHttp2Server
+                };
             }
 
             public static readonly IEnumerable<object[]> RemoteServersMemberData = GetRemoteServers().Select(s => new object[] { s });
diff --git a/src/libraries/Common/tests/System/Net/Configuration.WebSockets.cs b/src/libraries/Common/tests/System/Net/Configuration.WebSockets.cs
index c5686be67b4ef9..d0f1eab545177e 100644
--- a/src/libraries/Common/tests/System/Net/Configuration.WebSockets.cs
+++ b/src/libraries/Common/tests/System/Net/Configuration.WebSockets.cs
@@ -28,11 +28,14 @@ public static object[][] GetEchoServers()
                 {
                     // https://github.com/dotnet/runtime/issues/101115
                     return new object[][] {
-                        new object[] { RemoteEchoServer },
+                        // [ActiveIssue("https://github.com/dotnet/runtime/issues/110578)]
+                        // new object[] { RemoteEchoServer },
+
                     };
                 }
                 return new object[][] {
-                    new object[] { RemoteEchoServer },
+                    // [ActiveIssue("https://github.com/dotnet/runtime/issues/110578)]
+                    // new object[] { RemoteEchoServer },
                     new object[] { SecureRemoteEchoServer },
                 };
             }
@@ -43,11 +46,13 @@ public static object[][] GetEchoHeadersServers()
                 {
                     // https://github.com/dotnet/runtime/issues/101115
                     return new object[][] {
-                        new object[] { RemoteEchoHeadersServer },
+                        // [ActiveIssue("https://github.com/dotnet/runtime/issues/110578)]
+                        // new object[] { RemoteEchoHeadersServer },
                     };
                 }
                 return new object[][] {
-                    new object[] { RemoteEchoHeadersServer },
+                    // [ActiveIssue("https://github.com/dotnet/runtime/issues/110578)]
+                    // new object[] { RemoteEchoHeadersServer },
                     new object[] { SecureRemoteEchoHeadersServer },
                 };
             }
diff --git a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.RemoteServer.cs b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.RemoteServer.cs
index dd9db9bbe1f087..04cfc593343f85 100644
--- a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.RemoteServer.cs
+++ b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.RemoteServer.cs
@@ -70,7 +70,7 @@ public async Task UseDefaultCredentials_SetToFalseAndServerNeedsAuth_StatusCodeU
             handler.UseDefaultCredentials = false;
             using (HttpClient client = CreateHttpClient(handler))
             {
-                Uri uri = Configuration.Http.RemoteHttp11Server.NegotiateAuthUriForDefaultCreds;
+                Uri uri = Configuration.Http.RemoteSecureHttp11Server.NegotiateAuthUriForDefaultCreds;
                 _output.WriteLine("Uri: {0}", uri);
                 using (HttpResponseMessage response = await client.GetAsync(uri))
                 {
@@ -601,9 +601,9 @@ public async Task PostAsync_CallMethod_EmptyContent(Configuration.Http.RemoteSer
         public static IEnumerable<object[]> ExpectContinueVersion()
         {
             return
-                from expect in new bool?[] {true, false, null}
-                from version in new Version[] {new Version(1, 0), new Version(1, 1), new Version(2, 0)}
-                select new object[] {expect, version};
+                from expect in new bool?[] { true, false, null }
+                from version in new Version[] { new Version(1, 0), new Version(1, 1), new Version(2, 0) }
+                select new object[] { expect, version };
         }
 
         [OuterLoop("Uses external servers", typeof(PlatformDetection), nameof(PlatformDetection.LocalEchoServerIsNotAvailable))]
@@ -775,7 +775,8 @@ public async Task SendAsync_SendRequestUsingMethodToEchoServerWithNoContent_Meth
             {
                 var request = new HttpRequestMessage(
                     new HttpMethod(method),
-                    serverUri) { Version = UseVersion };
+                    serverUri)
+                { Version = UseVersion };
 
                 using (HttpResponseMessage response = await client.SendAsync(TestAsync, request))
                 {
@@ -801,7 +802,8 @@ public async Task SendAsync_SendRequestUsingMethodToEchoServerWithContent_Succes
             {
                 var request = new HttpRequestMessage(
                     new HttpMethod(method),
-                    serverUri) { Version = UseVersion };
+                    serverUri)
+                { Version = UseVersion };
                 request.Content = new StringContent(ExpectedContent);
                 using (HttpResponseMessage response = await client.SendAsync(TestAsync, request))
                 {
@@ -980,6 +982,7 @@ public async Task GetAsync_AllowAutoRedirectTrue_RedirectFromHttpToHttp_StatusCo
         [OuterLoop("Uses external servers")]
         [Fact]
         [ActiveIssue("https://github.com/dotnet/runtime/issues/55083", TestPlatforms.Browser)]
+        [ActiveIssue("https://github.com/dotnet/runtime/issues/110578")]
         public async Task GetAsync_AllowAutoRedirectTrue_RedirectFromHttpToHttps_StatusCodeOK()
         {
             HttpClientHandler handler = CreateHttpClientHandler();
@@ -1064,9 +1067,9 @@ public async Task GetAsync_MaxAutomaticRedirectionsNServerHops_ThrowsIfTooMany(i
             handler.MaxAutomaticRedirections = maxHops;
             using (HttpClient client = CreateHttpClient(handler))
             {
-                Task<HttpResponseMessage> t = client.GetAsync(Configuration.Http.RemoteHttp11Server.RedirectUriForDestinationUri(
+                Task<HttpResponseMessage> t = client.GetAsync(Configuration.Http.RemoteSecureHttp11Server.RedirectUriForDestinationUri(
                     statusCode: 302,
-                    destinationUri: Configuration.Http.RemoteHttp11Server.EchoUri,
+                    destinationUri: Configuration.Http.RemoteSecureHttp11Server.EchoUri,
                     hops: hops));
 
                 if (hops <= maxHops)
@@ -1074,7 +1077,7 @@ public async Task GetAsync_MaxAutomaticRedirectionsNServerHops_ThrowsIfTooMany(i
                     using (HttpResponseMessage response = await t)
                     {
                         Assert.Equal(HttpStatusCode.OK, response.StatusCode);
-                        Assert.Equal(Configuration.Http.RemoteEchoServer, response.RequestMessage.RequestUri);
+                        Assert.Equal(Configuration.Http.SecureRemoteEchoServer, response.RequestMessage.RequestUri);
                     }
                 }
                 else
diff --git a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.ServerCertificates.cs b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.ServerCertificates.cs
index 4dc2eb3fcfdeaf..95ba0752a5daa4 100644
--- a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.ServerCertificates.cs
+++ b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.ServerCertificates.cs
@@ -97,6 +97,7 @@ public async Task NoCallback_ValidCertificate_SuccessAndExpectedPropertyBehavior
 
         [OuterLoop("Uses external servers")]
         [Fact]
+        [ActiveIssue("https://github.com/dotnet/runtime/issues/110578")]
         public async Task UseCallback_NotSecureConnection_CallbackNotCalled()
         {
             HttpClientHandler handler = CreateHttpClientHandler();
diff --git a/src/libraries/System.Net.Http.WinHttpHandler/tests/FunctionalTests/ServerCertificateTest.cs b/src/libraries/System.Net.Http.WinHttpHandler/tests/FunctionalTests/ServerCertificateTest.cs
index df73619bf8dad8..4f7d573df68b09 100644
--- a/src/libraries/System.Net.Http.WinHttpHandler/tests/FunctionalTests/ServerCertificateTest.cs
+++ b/src/libraries/System.Net.Http.WinHttpHandler/tests/FunctionalTests/ServerCertificateTest.cs
@@ -32,6 +32,7 @@ public async Task NoCallback_ValidCertificate_CallbackNotCalled()
 
         [OuterLoop]
         [Fact]
+        [ActiveIssue("https://github.com/dotnet/runtime/issues/110578")]
         public async Task UseCallback_NotSecureConnection_CallbackNotCalled()
         {
             var handler = new WinHttpHandler();
diff --git a/src/libraries/System.Net.Http.WinHttpHandler/tests/FunctionalTests/WinHttpHandlerTest.cs b/src/libraries/System.Net.Http.WinHttpHandler/tests/FunctionalTests/WinHttpHandlerTest.cs
index 0abe14c11887bf..cc2b97bdde6da7 100644
--- a/src/libraries/System.Net.Http.WinHttpHandler/tests/FunctionalTests/WinHttpHandlerTest.cs
+++ b/src/libraries/System.Net.Http.WinHttpHandler/tests/FunctionalTests/WinHttpHandlerTest.cs
@@ -55,7 +55,7 @@ public async Task GetAsync_RedirectResponseHasCookie_CookieSentToFinalUri(
             string cookieName,
             string cookieValue)
         {
-            Uri uri = System.Net.Test.Common.Configuration.Http.RemoteHttp11Server.RedirectUriForDestinationUri(302, System.Net.Test.Common.Configuration.Http.RemoteEchoServer, 1);
+            Uri uri = System.Net.Test.Common.Configuration.Http.RemoteSecureHttp11Server.RedirectUriForDestinationUri(302, System.Net.Test.Common.Configuration.Http.SecureRemoteEchoServer, 1);
             var handler = new WinHttpHandler();
             handler.WindowsProxyUsePolicy = WindowsProxyUsePolicy.UseWinInetProxy;
             handler.CookieUsePolicy = cookieUsePolicy;
diff --git a/src/libraries/System.Net.Http/tests/FunctionalTests/MetricsTest.cs b/src/libraries/System.Net.Http/tests/FunctionalTests/MetricsTest.cs
index cb8a2b7c833556..473be2724c65da 100644
--- a/src/libraries/System.Net.Http/tests/FunctionalTests/MetricsTest.cs
+++ b/src/libraries/System.Net.Http/tests/FunctionalTests/MetricsTest.cs
@@ -381,7 +381,7 @@ public async Task ExternalServer_DurationMetrics_Recorded()
             using InstrumentRecorder<long> openConnectionsRecorder = SetupInstrumentRecorder<long>(InstrumentNames.OpenConnections);
 
             Uri uri = UseVersion == HttpVersion.Version11
-                ? Test.Common.Configuration.Http.RemoteHttp11Server.EchoUri
+                ? Test.Common.Configuration.Http.RemoteSecureHttp11Server.EchoUri
                 : Test.Common.Configuration.Http.RemoteHttp2Server.EchoUri;
             IPAddress[] addresses = await Dns.GetHostAddressesAsync(uri.Host);
             addresses = addresses.Union(addresses.Select(a => a.MapToIPv6())).ToArray();
@@ -1259,7 +1259,7 @@ public Task RequestDuration_Redirect_RecordedForEachHttpSpan()
                     });
 
                 }, options: new GenericLoopbackOptions() { UseSsl = true });
-            }, options: new GenericLoopbackOptions() { UseSsl = false});
+            }, options: new GenericLoopbackOptions() { UseSsl = false });
         }
 
         [Fact]