From 7774ed50fa4dd862c1a9a316019919dc24dd710b Mon Sep 17 00:00:00 2001 From: Andrew Stanton-Nurse Date: Thu, 30 Mar 2017 11:48:24 -0700 Subject: [PATCH] additional checks and logging for iisx shutdown (#997) --- .../Deployers/IISExpressDeployer.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/IISExpressDeployer.cs b/src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/IISExpressDeployer.cs index 9234f55a15..3c8311f391 100644 --- a/src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/IISExpressDeployer.cs +++ b/src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/IISExpressDeployer.cs @@ -291,6 +291,13 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting StopTimer(); } + + // If by this point, the host process is still running (somehow), throw an error. + // A test failure is better than a silent hang and unknown failure later on + if(!_hostProcess.HasExited) + { + throw new Exception($"iisexpress Process {_hostProcess.Id} failed to shutdown"); + } } } } \ No newline at end of file