Skip to content
This repository was archived by the owner on Dec 18, 2018. It is now read-only.

Commit 3c7e7d1

Browse files
committed
Make ConnectionFilterTests more reliable
1 parent c0e75dc commit 3c7e7d1

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

test/Microsoft.AspNetCore.Server.KestrelTests/ConnectionFilterTests.cs

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,19 @@ public async Task ThrowingSynchronousConnectionFilterDoesNotCrashServer()
8989
using (var connection = server.CreateConnection())
9090
{
9191
// Will throw because the exception in the connection filter will close the connection.
92-
await Assert.ThrowsAsync<IOException>(async () => await connection.SendEnd(
93-
"POST / HTTP/1.0",
94-
"Content-Length: 12",
95-
"",
96-
"Hello World?"));
92+
await Assert.ThrowsAsync<IOException>(async () =>
93+
{
94+
await connection.Send(
95+
"POST / HTTP/1.0",
96+
"Content-Length: 1000",
97+
"\r\n");
98+
99+
for (var i = 0; i < 1000; i++)
100+
{
101+
await connection.Send("a");
102+
await Task.Delay(5);
103+
}
104+
});
97105
}
98106
}
99107
}

0 commit comments

Comments
 (0)