From a9c5eb28d7f374af941f39a485573856ab3f0c18 Mon Sep 17 00:00:00 2001 From: Justin Kotalik Date: Thu, 25 Oct 2018 10:30:45 -0700 Subject: [PATCH] Fix test server shutdown issues (#1554) --- test/IIS.Tests/Utilities/TestServer.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/IIS.Tests/Utilities/TestServer.cs b/test/IIS.Tests/Utilities/TestServer.cs index cd3188bf83..351b826316 100644 --- a/test/IIS.Tests/Utilities/TestServer.cs +++ b/test/IIS.Tests/Utilities/TestServer.cs @@ -146,7 +146,14 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests public void Dispose() { HttpClient.Dispose(); - WebCoreShutdown(false); + + // WebCoreShutdown occasionally AVs + // This causes the dotnet test process to crash + // To avoid this, we have to wait to shutdown + // and pass in true to immediately shutdown the hostable web core + // Both of these seem to be required. + Thread.Sleep(100); + WebCoreShutdown(immediate: true); WebCoreLock.Release(); }