From e9c4c935f65df81782d42566070b2217db1377a0 Mon Sep 17 00:00:00 2001 From: Justin Kotalik Date: Wed, 5 Dec 2018 12:05:05 -0800 Subject: [PATCH] Remove FlushResultCancellationTests as it isn't relevant (#4435) --- .../Http/test/FlushResultCancellationTests.cs | 38 ------------------- 1 file changed, 38 deletions(-) diff --git a/src/Http/Http/test/FlushResultCancellationTests.cs b/src/Http/Http/test/FlushResultCancellationTests.cs index f4ab7cb96f..1251b60ebe 100644 --- a/src/Http/Http/test/FlushResultCancellationTests.cs +++ b/src/Http/Http/test/FlushResultCancellationTests.cs @@ -12,44 +12,6 @@ namespace Microsoft.AspNetCore.Http.Tests { public class FlushResultCancellationTests : PipeTest { - [Fact] - public void FlushAsyncCancellationDeadlock() - { - var cts = new CancellationTokenSource(); - var cts2 = new CancellationTokenSource(); - - PipeWriter buffer = Writer.WriteEmpty(MaximumSizeHigh); - - var e = new ManualResetEventSlim(); - - ValueTaskAwaiter awaiter = buffer.FlushAsync(cts.Token).GetAwaiter(); - awaiter.OnCompleted( - () => { - // We are on cancellation thread and need to wait until another FlushAsync call - // takes pipe state lock - e.Wait(); - - // Make sure we had enough time to reach _cancellationTokenRegistration.Dispose - Thread.Sleep(100); - - // Try to take pipe state lock - buffer.FlushAsync(); - }); - - // Start a thread that would run cancellation callbacks - Task cancellationTask = Task.Run(() => cts.Cancel()); - // Start a thread that would call FlushAsync with different token - // and block on _cancellationTokenRegistration.Dispose - Task blockingTask = Task.Run( - () => { - e.Set(); - buffer.FlushAsync(cts2.Token); - }); - - bool completed = Task.WhenAll(cancellationTask, blockingTask).Wait(TimeSpan.FromSeconds(10)); - Assert.True(completed); - } - [Fact] public async Task FlushAsyncWithNewCancellationTokenNotAffectedByPrevious() {