Skip to content

Commit

Permalink
Disable more tests dependent on http://corefx-net-http11.azurewebsite…
Browse files Browse the repository at this point in the history
…s.net (#111354)

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

* Disable winhttphandlertests
  • Loading branch information
rzikm authored Jan 14, 2025
1 parent 69b3d4a commit 9fea441
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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))
{
Expand Down Expand Up @@ -602,9 +602,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))]
Expand Down Expand Up @@ -776,7 +776,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))
{
Expand All @@ -802,7 +803,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))
{
Expand Down Expand Up @@ -981,6 +983,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();
Expand Down Expand Up @@ -1065,17 +1068,17 @@ 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)
{
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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]
Expand Down

0 comments on commit 9fea441

Please sign in to comment.