Skip to content

Commit f88a865

Browse files
rzikmmichaelgsharp
authored andcommitted
Disable frequently failing tests (dotnet#101439)
1 parent 595b900 commit f88a865

File tree

4 files changed

+50
-26
lines changed

4 files changed

+50
-26
lines changed

src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Cookies.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,10 +216,15 @@ private string GetCookieValue(HttpRequestData request)
216216
return cookieHeaderValue;
217217
}
218218

219-
[Fact]
219+
[ConditionalFact]
220220
[SkipOnPlatform(TestPlatforms.Browser, "CookieContainer is not supported on Browser")]
221221
public async Task GetAsync_SetCookieContainerAndCookieHeader_BothCookiesSent()
222222
{
223+
if (UseVersion == HttpVersion30)
224+
{
225+
throw new SkipTestException("https://github.com/dotnet/runtime/issues/101377");
226+
}
227+
223228
await LoopbackServerFactory.CreateServerAsync(async (server, url) =>
224229
{
225230
HttpClientHandler handler = CreateHttpClientHandler();
@@ -313,7 +318,7 @@ await LoopbackServerFactory.CreateClientAndServerAsync(async url =>
313318
using (HttpClient client = CreateHttpClient(handler))
314319
{
315320
client.DefaultRequestHeaders.ConnectionClose = true; // to avoid issues with connection pooling
316-
await client.GetAsync(url1);
321+
await client.GetAsync(url1);
317322
}
318323
},
319324
async server =>

src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.cs

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ await LoopbackServer.CreateClientAndServerAsync(async proxyUri =>
270270
public static IEnumerable<object[]> SecureAndNonSecure_IPBasedUri_MemberData() =>
271271
from address in new[] { IPAddress.Loopback, IPAddress.IPv6Loopback }
272272
from useSsl in BoolValues
273-
// we could not create SslStream in browser, [ActiveIssue("https://github.com/dotnet/runtime/issues/37669", TestPlatforms.Browser)]
273+
// we could not create SslStream in browser, [ActiveIssue("https://github.com/dotnet/runtime/issues/37669", TestPlatforms.Browser)]
274274
where PlatformDetection.IsNotBrowser || !useSsl
275275
select new object[] { address, useSsl };
276276

@@ -880,8 +880,8 @@ await LoopbackServer.CreateClientAndServerAsync(async url =>
880880
"\r\n" +
881881
"5\r\n" +
882882
"hello" + // missing \r\n terminator
883-
//"5\r\n" +
884-
//"world" + // missing \r\n terminator
883+
//"5\r\n" +
884+
//"world" + // missing \r\n terminator
885885
"0\r\n" +
886886
"\r\n"));
887887
}
@@ -985,7 +985,7 @@ await connection.WriteStringAsync(
985985
});
986986
}
987987

988-
[Theory]
988+
[ConditionalTheory]
989989
[InlineData(true, true, true)]
990990
[InlineData(true, true, false)]
991991
[InlineData(true, false, false)]
@@ -995,6 +995,11 @@ await connection.WriteStringAsync(
995995
[ActiveIssue("https://github.com/dotnet/runtime/issues/65429", typeof(PlatformDetection), nameof(PlatformDetection.IsNodeJS))]
996996
public async Task ReadAsStreamAsync_HandlerProducesWellBehavedResponseStream(bool? chunked, bool enableWasmStreaming, bool slowChunks)
997997
{
998+
if (UseVersion == HttpVersion30)
999+
{
1000+
throw new SkipTestException("https://github.com/dotnet/runtime/issues/91757");
1001+
}
1002+
9981003
if (IsWinHttpHandler && UseVersion >= HttpVersion20.Value)
9991004
{
10001005
return;
@@ -1094,7 +1099,7 @@ await LoopbackServerFactory.CreateClientAndServerAsync(async uri =>
10941099
if (PlatformDetection.IsBrowser)
10951100
{
10961101
#if !NETFRAMEWORK
1097-
if(slowChunks)
1102+
if (slowChunks)
10981103
{
10991104
Assert.Equal(1, await responseStream.ReadAsync(new Memory<byte>(buffer2)));
11001105
Assert.Equal((byte)'h', buffer2[0]);
@@ -1204,7 +1209,7 @@ await server.AcceptConnectionAsync(async connection =>
12041209
{
12051210
case true:
12061211
await connection.SendResponseAsync(HttpStatusCode.OK, headers: new HttpHeaderData[] { new HttpHeaderData("Transfer-Encoding", "chunked") }, isFinal: false);
1207-
if(PlatformDetection.IsBrowser && slowChunks)
1212+
if (PlatformDetection.IsBrowser && slowChunks)
12081213
{
12091214
await connection.SendResponseBodyAsync("1\r\nh\r\n", false);
12101215
await tcs.Task;
@@ -1219,12 +1224,12 @@ await server.AcceptConnectionAsync(async connection =>
12191224
break;
12201225

12211226
case false:
1222-
await connection.SendResponseAsync(HttpStatusCode.OK, headers: new HttpHeaderData[] { new HttpHeaderData("Content-Length", "11")}, content: "hello world");
1227+
await connection.SendResponseAsync(HttpStatusCode.OK, headers: new HttpHeaderData[] { new HttpHeaderData("Content-Length", "11") }, content: "hello world");
12231228
break;
12241229

12251230
case null:
12261231
// This inject Content-Length header with null value to hint Loopback code to not include one automatically.
1227-
await connection.SendResponseAsync(HttpStatusCode.OK, headers: new HttpHeaderData[] { new HttpHeaderData("Content-Length", null)}, isFinal: false);
1232+
await connection.SendResponseAsync(HttpStatusCode.OK, headers: new HttpHeaderData[] { new HttpHeaderData("Content-Length", null) }, isFinal: false);
12281233
await connection.SendResponseBodyAsync("hello world");
12291234
break;
12301235
}
@@ -1459,10 +1464,10 @@ await LoopbackServerFactory.CreateServerAsync(async (server3, url3) =>
14591464
Task serverTask3 = server3.AcceptConnectionAsync(async connection3 =>
14601465
{
14611466
await connection3.ReadRequestDataAsync();
1462-
await connection3.SendResponseAsync(HttpStatusCode.OK, new HttpHeaderData[] { new HttpHeaderData("Content-Length", "20") }, isFinal : false);
1463-
await connection3.SendResponseBodyAsync("1234567890", isFinal : false);
1467+
await connection3.SendResponseAsync(HttpStatusCode.OK, new HttpHeaderData[] { new HttpHeaderData("Content-Length", "20") }, isFinal: false);
1468+
await connection3.SendResponseBodyAsync("1234567890", isFinal: false);
14641469
await unblockServers.Task;
1465-
await connection3.SendResponseBodyAsync("1234567890", isFinal : true);
1470+
await connection3.SendResponseBodyAsync("1234567890", isFinal: true);
14661471
});
14671472

14681473
// Make three requests
@@ -1536,7 +1541,7 @@ public async Task GetAsync_UnicodeHostName_SuccessStatusCodeInResponse()
15361541
}
15371542
}
15381543

1539-
#region Post Methods Tests
1544+
#region Post Methods Tests
15401545

15411546
[Fact]
15421547
[SkipOnPlatform(TestPlatforms.Browser, "ExpectContinue not supported on Browser")]
@@ -1580,13 +1585,13 @@ await server.AcceptConnectionAsync(async connection =>
15801585

15811586
public static IEnumerable<object[]> Interim1xxStatusCode()
15821587
{
1583-
yield return new object[] { (HttpStatusCode) 100 }; // 100 Continue.
1588+
yield return new object[] { (HttpStatusCode)100 }; // 100 Continue.
15841589
// 101 SwitchingProtocols will be treated as a final status code.
1585-
yield return new object[] { (HttpStatusCode) 102 }; // 102 Processing.
1586-
yield return new object[] { (HttpStatusCode) 103 }; // 103 EarlyHints.
1587-
yield return new object[] { (HttpStatusCode) 150 };
1588-
yield return new object[] { (HttpStatusCode) 180 };
1589-
yield return new object[] { (HttpStatusCode) 199 };
1590+
yield return new object[] { (HttpStatusCode)102 }; // 102 Processing.
1591+
yield return new object[] { (HttpStatusCode)103 }; // 103 EarlyHints.
1592+
yield return new object[] { (HttpStatusCode)150 };
1593+
yield return new object[] { (HttpStatusCode)180 };
1594+
yield return new object[] { (HttpStatusCode)199 };
15901595
}
15911596

15921597
[Theory]
@@ -1647,7 +1652,7 @@ await server.AcceptConnectionAsync(async connection =>
16471652
new HttpHeaderData("Content-type", "text/xml"),
16481653
new HttpHeaderData("Set-Cookie", SetCookieIgnored1)}, isFinal: false);
16491654

1650-
await connection.SendResponseAsync(responseStatusCode, headers: new HttpHeaderData[] {
1655+
await connection.SendResponseAsync(responseStatusCode, headers: new HttpHeaderData[] {
16511656
new HttpHeaderData("Cookie", "ignore_cookie=choco2"),
16521657
new HttpHeaderData("Content-type", "text/plain"),
16531658
new HttpHeaderData("Set-Cookie", SetCookieIgnored2)}, isFinal: false);
@@ -1751,7 +1756,7 @@ await server.AcceptConnectionAsync(async connection =>
17511756
{
17521757
await connection.ReadRequestDataAsync(readBody: false);
17531758
// Send multiple 100-Continue responses.
1754-
for (int count = 0 ; count < 4; count++)
1759+
for (int count = 0; count < 4; count++)
17551760
{
17561761
await connection.SendResponseAsync(HttpStatusCode.Continue, isFinal: false);
17571762
}
@@ -1855,7 +1860,7 @@ await server.AcceptConnectionAsync(async connection =>
18551860
{
18561861
await connection.ReadRequestDataAsync(readBody: false);
18571862

1858-
await connection.SendResponseAsync(HttpStatusCode.OK, headers: new HttpHeaderData[] {new HttpHeaderData("Content-Length", $"{ResponseString.Length}")}, isFinal : false);
1863+
await connection.SendResponseAsync(HttpStatusCode.OK, headers: new HttpHeaderData[] { new HttpHeaderData("Content-Length", $"{ResponseString.Length}") }, isFinal: false);
18591864

18601865
byte[] body = await connection.ReadRequestBodyAsync();
18611866
Assert.Equal(RequestString, Encoding.ASCII.GetString(body));
@@ -2136,7 +2141,7 @@ await LoopbackServerFactory.CreateServerAsync(async (server, rootUrl) =>
21362141
}
21372142
});
21382143
}
2139-
#endregion
2144+
#endregion
21402145

21412146
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowserDomSupported))]
21422147
public async Task GetAsync_InvalidUrl_ExpectedExceptionThrown()

src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.AltSvc.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
using System.Net.Test.Common;
99
using System.Net.Quic;
1010

11+
using Microsoft.DotNet.XUnitExtensions;
12+
1113
namespace System.Net.Http.Functional.Tests
1214
{
1315
public abstract class HttpClientHandler_AltSvc_Test : HttpClientHandlerTestBase
@@ -71,9 +73,14 @@ public async Task AltSvc_Header_Upgrade_Success(Version fromVersion, bool overri
7173
{ HttpVersion.Version20, false }
7274
};
7375

74-
[Fact]
76+
[ConditionalFact]
7577
public async Task AltSvc_ConnectionFrame_UpgradeFrom20_Success()
7678
{
79+
if (UseVersion == HttpVersion30)
80+
{
81+
throw new SkipTestException("https://github.com/dotnet/runtime/issues/101376");
82+
}
83+
7784
using Http2LoopbackServer firstServer = Http2LoopbackServer.CreateServer();
7885
using Http3LoopbackServer secondServer = CreateHttp3LoopbackServer();
7986
using HttpClient client = CreateHttpClient(HttpVersion.Version20);

src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.Headers.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
using Xunit;
1414
using Xunit.Abstractions;
1515

16+
using Microsoft.DotNet.XUnitExtensions;
17+
1618
namespace System.Net.Http.Functional.Tests
1719
{
1820
using Configuration = System.Net.Test.Common.Configuration;
@@ -283,12 +285,17 @@ await LoopbackServerFactory.CreateClientAndServerAsync(async uri =>
283285
});
284286
}
285287

286-
[Theory]
288+
[ConditionalTheory]
287289
[InlineData("Thu, 01 Dec 1994 16:00:00 GMT", true)]
288290
[InlineData("-1", false)]
289291
[InlineData("0", false)]
290292
public async Task SendAsync_Expires_Success(string value, bool isValid)
291293
{
294+
if (UseVersion == HttpVersion30)
295+
{
296+
throw new SkipTestException("https://github.com/dotnet/runtime/issues/91757");
297+
}
298+
292299
await LoopbackServerFactory.CreateClientAndServerAsync(async uri =>
293300
{
294301
using (HttpClient client = CreateHttpClient())

0 commit comments

Comments
 (0)