From d318d7b94dd4e48c5718ca35487ab7e3e8b73951 Mon Sep 17 00:00:00 2001 From: David Fowler Date: Thu, 23 Aug 2018 22:29:56 -0700 Subject: [PATCH] Make tests less flaky (#2848) - Re-order logs with completing the task --- src/Kestrel.Core/Internal/ConnectionDispatcher.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Kestrel.Core/Internal/ConnectionDispatcher.cs b/src/Kestrel.Core/Internal/ConnectionDispatcher.cs index 20829ebb14..a3b47a709f 100644 --- a/src/Kestrel.Core/Internal/ConnectionDispatcher.cs +++ b/src/Kestrel.Core/Internal/ConnectionDispatcher.cs @@ -84,12 +84,12 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal } finally { + Log.ConnectionStop(connectionContext.ConnectionId); + KestrelEventSource.Log.ConnectionStop(connectionContext); + connection.Complete(); _serviceContext.ConnectionManager.RemoveConnection(id); - - Log.ConnectionStop(connectionContext.ConnectionId); - KestrelEventSource.Log.ConnectionStop(connectionContext); } }