From 80b9673693f8fba2946d51aa4b6edce3906d95b5 Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Tue, 21 Feb 2017 16:04:32 -0800 Subject: [PATCH] Temporary add delay to connection test to make it pass (#1384) --- .../ConnectionTests.cs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/test/Microsoft.AspNetCore.Server.KestrelTests/ConnectionTests.cs b/test/Microsoft.AspNetCore.Server.KestrelTests/ConnectionTests.cs index cbffa6aaff..2310329ff2 100644 --- a/test/Microsoft.AspNetCore.Server.KestrelTests/ConnectionTests.cs +++ b/test/Microsoft.AspNetCore.Server.KestrelTests/ConnectionTests.cs @@ -50,12 +50,18 @@ namespace Microsoft.AspNetCore.Server.KestrelTests mockLibuv.AllocCallback(socket.InternalGetHandle(), 2048, out ignored); mockLibuv.ReadCallback(socket.InternalGetHandle(), 0, ref ignored); - var readAwaitable = connection.Input.Reader.ReadAsync(); - - var result = readAwaitable.GetResult(); - Assert.False(result.IsCompleted); }, (object)null); + // Wait until ProcessRequestAsync runs + // TODO: Remove when we get non dispatching support + await Task.Delay(1000); + + await context.Thread.PostAsync(_ => + { + var readAwaitable = connection.Input.Reader.ReadAsync(); + + Assert.False(readAwaitable.IsCompleted); + }, (object)null); connection.ConnectionControl.End(ProduceEndType.SocketDisconnect); } }