Fix test failures caused by connection resets (#1167).
This commit is contained in:
parent
5e97c63467
commit
cc05e36dc6
|
|
@ -580,6 +580,7 @@ namespace Microsoft.AspNetCore.Server.KestrelTests
|
||||||
{
|
{
|
||||||
using (var server = new TestServer(async httpContext =>
|
using (var server = new TestServer(async httpContext =>
|
||||||
{
|
{
|
||||||
|
// This will hang if 0 content length is not assumed by the server
|
||||||
Assert.Equal(0, await httpContext.Request.Body.ReadAsync(new byte[1], 0, 1).TimeoutAfter(TimeSpan.FromSeconds(10)));
|
Assert.Equal(0, await httpContext.Request.Body.ReadAsync(new byte[1], 0, 1).TimeoutAfter(TimeSpan.FromSeconds(10)));
|
||||||
}, testContext))
|
}, testContext))
|
||||||
{
|
{
|
||||||
|
|
@ -592,8 +593,8 @@ namespace Microsoft.AspNetCore.Server.KestrelTests
|
||||||
"GET / HTTP/1.1",
|
"GET / HTTP/1.1",
|
||||||
"Connection: close",
|
"Connection: close",
|
||||||
"",
|
"",
|
||||||
"a");
|
"");
|
||||||
await connection.ReceiveEnd(
|
await connection.ReceiveForcedEnd(
|
||||||
"HTTP/1.1 200 OK",
|
"HTTP/1.1 200 OK",
|
||||||
"Connection: close",
|
"Connection: close",
|
||||||
$"Date: {testContext.DateHeaderValue}",
|
$"Date: {testContext.DateHeaderValue}",
|
||||||
|
|
@ -607,8 +608,8 @@ namespace Microsoft.AspNetCore.Server.KestrelTests
|
||||||
await connection.Send(
|
await connection.Send(
|
||||||
"GET / HTTP/1.0",
|
"GET / HTTP/1.0",
|
||||||
"",
|
"",
|
||||||
"a");
|
"");
|
||||||
await connection.ReceiveEnd(
|
await connection.ReceiveForcedEnd(
|
||||||
"HTTP/1.1 200 OK",
|
"HTTP/1.1 200 OK",
|
||||||
"Connection: close",
|
"Connection: close",
|
||||||
$"Date: {testContext.DateHeaderValue}",
|
$"Date: {testContext.DateHeaderValue}",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue