From a4def946a64062b75b0a144f6125f2c0df62d026 Mon Sep 17 00:00:00 2001 From: Stephen Halter Date: Mon, 24 Apr 2017 23:48:47 -0700 Subject: [PATCH] Fix flaky 400 response tests (#1758) --- .../UpgradeTests.cs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/UpgradeTests.cs b/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/UpgradeTests.cs index d56ecf4d00..1249524bc5 100644 --- a/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/UpgradeTests.cs +++ b/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/UpgradeTests.cs @@ -123,7 +123,13 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests "", "1"); - await connection.Receive("HTTP/1.1 400 Bad Request"); + await connection.ReceiveForcedEnd( + "HTTP/1.1 400 Bad Request", + "Connection: close", + $"Date: {server.Context.DateHeaderValue}", + "Content-Length: 0", + "", + ""); } } @@ -167,7 +173,13 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests "Connection: Upgrade", "", ""); - await connection.Receive("HTTP/1.1 400 Bad Request"); + await connection.ReceiveForcedEnd( + "HTTP/1.1 400 Bad Request", + "Connection: close", + $"Date: {server.Context.DateHeaderValue}", + "Content-Length: 0", + "", + ""); } } }