From 21ef9f3c394fe7523abfd29a94ecf9d7069ec02e Mon Sep 17 00:00:00 2001 From: Stephen Halter Date: Tue, 18 Dec 2018 12:37:25 -0800 Subject: [PATCH] Revert "Fix flakiness in RequestsCanBeAbortedMidRead (#4881)" (#5708) This was never supposed be be merged into release/2.2 or master since both those branches include aspnet/KestrelHttpServer#2844. This reverts commit 019ba081d38b5410aa0c7808275c0fd78d8f32fc. --- src/Servers/Kestrel/test/FunctionalTests/RequestTests.cs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/Servers/Kestrel/test/FunctionalTests/RequestTests.cs b/src/Servers/Kestrel/test/FunctionalTests/RequestTests.cs index 5f65c4a3aa..864c8fdc24 100644 --- a/src/Servers/Kestrel/test/FunctionalTests/RequestTests.cs +++ b/src/Servers/Kestrel/test/FunctionalTests/RequestTests.cs @@ -709,12 +709,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests } } - var thrownEx = await Assert.ThrowsAnyAsync(async () => await readTcs.Task).DefaultTimeout(); - - // https://github.com/aspnet/AspNetCore-Internal/issues/1521 - // In more recent versions of Kestrel, we expect this to always be a TaskCanceledException, - // but without the changes in https://github.com/aspnet/KestrelHttpServer/pull/2844, this is flaky. - Assert.True(thrownEx is TaskCanceledException || thrownEx is IOException, $"{thrownEx} is neither a TaskCanceledException nor IOException."); + await Assert.ThrowsAsync(async () => await readTcs.Task); // The cancellation token for only the last request should be triggered. var abortedRequestId = await registrationTcs.Task.DefaultTimeout();