Skip to content

Commit 5fec6dc

Browse files
committed
Revert "Disable frequently failing tests (dotnet#101439)"
This reverts commit e01db17.
1 parent b435427 commit 5fec6dc

File tree

4 files changed

+26
-50
lines changed

4 files changed

+26
-50
lines changed

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

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

219-
[ConditionalFact]
219+
[Fact]
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-
228223
await LoopbackServerFactory.CreateServerAsync(async (server, url) =>
229224
{
230225
HttpClientHandler handler = CreateHttpClientHandler();
@@ -318,7 +313,7 @@ await LoopbackServerFactory.CreateClientAndServerAsync(async url =>
318313
using (HttpClient client = CreateHttpClient(handler))
319314
{
320315
client.DefaultRequestHeaders.ConnectionClose = true; // to avoid issues with connection pooling
321-
await client.GetAsync(url1);
316+
await client.GetAsync(url1);
322317
}
323318
},
324319
async server =>

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

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

@@ -882,8 +882,8 @@ await LoopbackServer.CreateClientAndServerAsync(async url =>
882882
"\r\n" +
883883
"5\r\n" +
884884
"hello" + // missing \r\n terminator
885-
//"5\r\n" +
886-
//"world" + // missing \r\n terminator
885+
//"5\r\n" +
886+
//"world" + // missing \r\n terminator
887887
"0\r\n" +
888888
"\r\n"));
889889
}
@@ -988,7 +988,7 @@ await connection.WriteStringAsync(
988988
});
989989
}
990990

991-
[ConditionalTheory]
991+
[Theory]
992992
[InlineData(true, true, true)]
993993
[InlineData(true, true, false)]
994994
[InlineData(true, false, false)]
@@ -998,11 +998,6 @@ await connection.WriteStringAsync(
998998
[ActiveIssue("https://github.com/dotnet/runtime/issues/65429", typeof(PlatformDetection), nameof(PlatformDetection.IsNodeJS))]
999999
public async Task ReadAsStreamAsync_HandlerProducesWellBehavedResponseStream(bool? chunked, bool enableWasmStreaming, bool slowChunks)
10001000
{
1001-
if (UseVersion == HttpVersion30)
1002-
{
1003-
throw new SkipTestException("https://github.com/dotnet/runtime/issues/91757");
1004-
}
1005-
10061001
if (IsWinHttpHandler && UseVersion >= HttpVersion20.Value)
10071002
{
10081003
return;
@@ -1102,7 +1097,7 @@ await LoopbackServerFactory.CreateClientAndServerAsync(async uri =>
11021097
if (PlatformDetection.IsBrowser)
11031098
{
11041099
#if !NETFRAMEWORK
1105-
if (slowChunks)
1100+
if(slowChunks)
11061101
{
11071102
Assert.Equal(1, await responseStream.ReadAsync(new Memory<byte>(buffer2)));
11081103
Assert.Equal((byte)'h', buffer2[0]);
@@ -1212,7 +1207,7 @@ await server.AcceptConnectionAsync(async connection =>
12121207
{
12131208
case true:
12141209
await connection.SendResponseAsync(HttpStatusCode.OK, headers: new HttpHeaderData[] { new HttpHeaderData("Transfer-Encoding", "chunked") }, isFinal: false);
1215-
if (PlatformDetection.IsBrowser && slowChunks)
1210+
if(PlatformDetection.IsBrowser && slowChunks)
12161211
{
12171212
await connection.SendResponseBodyAsync("1\r\nh\r\n", false);
12181213
await tcs.Task;
@@ -1227,12 +1222,12 @@ await server.AcceptConnectionAsync(async connection =>
12271222
break;
12281223

12291224
case false:
1230-
await connection.SendResponseAsync(HttpStatusCode.OK, headers: new HttpHeaderData[] { new HttpHeaderData("Content-Length", "11") }, content: "hello world");
1225+
await connection.SendResponseAsync(HttpStatusCode.OK, headers: new HttpHeaderData[] { new HttpHeaderData("Content-Length", "11")}, content: "hello world");
12311226
break;
12321227

12331228
case null:
12341229
// This inject Content-Length header with null value to hint Loopback code to not include one automatically.
1235-
await connection.SendResponseAsync(HttpStatusCode.OK, headers: new HttpHeaderData[] { new HttpHeaderData("Content-Length", null) }, isFinal: false);
1230+
await connection.SendResponseAsync(HttpStatusCode.OK, headers: new HttpHeaderData[] { new HttpHeaderData("Content-Length", null)}, isFinal: false);
12361231
await connection.SendResponseBodyAsync("hello world");
12371232
break;
12381233
}
@@ -1468,10 +1463,10 @@ await LoopbackServerFactory.CreateServerAsync(async (server3, url3) =>
14681463
Task serverTask3 = server3.AcceptConnectionAsync(async connection3 =>
14691464
{
14701465
await connection3.ReadRequestDataAsync();
1471-
await connection3.SendResponseAsync(HttpStatusCode.OK, new HttpHeaderData[] { new HttpHeaderData("Content-Length", "20") }, isFinal: false);
1472-
await connection3.SendResponseBodyAsync("1234567890", isFinal: false);
1466+
await connection3.SendResponseAsync(HttpStatusCode.OK, new HttpHeaderData[] { new HttpHeaderData("Content-Length", "20") }, isFinal : false);
1467+
await connection3.SendResponseBodyAsync("1234567890", isFinal : false);
14731468
await unblockServers.Task;
1474-
await connection3.SendResponseBodyAsync("1234567890", isFinal: true);
1469+
await connection3.SendResponseBodyAsync("1234567890", isFinal : true);
14751470
});
14761471

14771472
// Make three requests
@@ -1545,7 +1540,7 @@ public async Task GetAsync_UnicodeHostName_SuccessStatusCodeInResponse()
15451540
}
15461541
}
15471542

1548-
#region Post Methods Tests
1543+
#region Post Methods Tests
15491544

15501545
[Fact]
15511546
[SkipOnPlatform(TestPlatforms.Browser, "ExpectContinue not supported on Browser")]
@@ -1589,13 +1584,13 @@ await server.AcceptConnectionAsync(async connection =>
15891584

15901585
public static IEnumerable<object[]> Interim1xxStatusCode()
15911586
{
1592-
yield return new object[] { (HttpStatusCode)100 }; // 100 Continue.
1587+
yield return new object[] { (HttpStatusCode) 100 }; // 100 Continue.
15931588
// 101 SwitchingProtocols will be treated as a final status code.
1594-
yield return new object[] { (HttpStatusCode)102 }; // 102 Processing.
1595-
yield return new object[] { (HttpStatusCode)103 }; // 103 EarlyHints.
1596-
yield return new object[] { (HttpStatusCode)150 };
1597-
yield return new object[] { (HttpStatusCode)180 };
1598-
yield return new object[] { (HttpStatusCode)199 };
1589+
yield return new object[] { (HttpStatusCode) 102 }; // 102 Processing.
1590+
yield return new object[] { (HttpStatusCode) 103 }; // 103 EarlyHints.
1591+
yield return new object[] { (HttpStatusCode) 150 };
1592+
yield return new object[] { (HttpStatusCode) 180 };
1593+
yield return new object[] { (HttpStatusCode) 199 };
15991594
}
16001595

16011596
[Theory]
@@ -1656,7 +1651,7 @@ await server.AcceptConnectionAsync(async connection =>
16561651
new HttpHeaderData("Content-type", "text/xml"),
16571652
new HttpHeaderData("Set-Cookie", SetCookieIgnored1)}, isFinal: false);
16581653

1659-
await connection.SendResponseAsync(responseStatusCode, headers: new HttpHeaderData[] {
1654+
await connection.SendResponseAsync(responseStatusCode, headers: new HttpHeaderData[] {
16601655
new HttpHeaderData("Cookie", "ignore_cookie=choco2"),
16611656
new HttpHeaderData("Content-type", "text/plain"),
16621657
new HttpHeaderData("Set-Cookie", SetCookieIgnored2)}, isFinal: false);
@@ -1760,7 +1755,7 @@ await server.AcceptConnectionAsync(async connection =>
17601755
{
17611756
await connection.ReadRequestDataAsync(readBody: false);
17621757
// Send multiple 100-Continue responses.
1763-
for (int count = 0; count < 4; count++)
1758+
for (int count = 0 ; count < 4; count++)
17641759
{
17651760
await connection.SendResponseAsync(HttpStatusCode.Continue, isFinal: false);
17661761
}
@@ -1864,7 +1859,7 @@ await server.AcceptConnectionAsync(async connection =>
18641859
{
18651860
await connection.ReadRequestDataAsync(readBody: false);
18661861

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

18691864
byte[] body = await connection.ReadRequestBodyAsync();
18701865
Assert.Equal(RequestString, Encoding.ASCII.GetString(body));
@@ -2129,7 +2124,7 @@ await LoopbackServerFactory.CreateServerAsync(async (server, rootUrl) =>
21292124
}
21302125
});
21312126
}
2132-
#endregion
2127+
#endregion
21332128

21342129
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowserDomSupported))]
21352130
public async Task GetAsync_InvalidUrl_ExpectedExceptionThrown()

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

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

11-
using Microsoft.DotNet.XUnitExtensions;
12-
1311
namespace System.Net.Http.Functional.Tests
1412
{
1513
public abstract class HttpClientHandler_AltSvc_Test : HttpClientHandlerTestBase
@@ -73,14 +71,9 @@ public async Task AltSvc_Header_Upgrade_Success(Version fromVersion, bool overri
7371
{ HttpVersion.Version20, false }
7472
};
7573

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

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

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

16-
using Microsoft.DotNet.XUnitExtensions;
17-
1816
namespace System.Net.Http.Functional.Tests
1917
{
2018
using Configuration = System.Net.Test.Common.Configuration;
@@ -289,17 +287,12 @@ await LoopbackServerFactory.CreateClientAndServerAsync(async uri =>
289287
});
290288
}
291289

292-
[ConditionalTheory]
290+
[Theory]
293291
[InlineData("Thu, 01 Dec 1994 16:00:00 GMT", true)]
294292
[InlineData("-1", false)]
295293
[InlineData("0", false)]
296294
public async Task SendAsync_Expires_Success(string value, bool isValid)
297295
{
298-
if (UseVersion == HttpVersion30)
299-
{
300-
throw new SkipTestException("https://github.com/dotnet/runtime/issues/91757");
301-
}
302-
303296
await LoopbackServerFactory.CreateClientAndServerAsync(async uri =>
304297
{
305298
using (HttpClient client = CreateHttpClient())

0 commit comments

Comments
 (0)