diff --git a/test/IISIntegration.FunctionalTests/Inprocess/LoggingTests.cs b/test/IISIntegration.FunctionalTests/Inprocess/LoggingTests.cs index b3c3dd89df..60e39ceb35 100644 --- a/test/IISIntegration.FunctionalTests/Inprocess/LoggingTests.cs +++ b/test/IISIntegration.FunctionalTests/Inprocess/LoggingTests.cs @@ -33,7 +33,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests Assert.Equal("Hello World", responseText); - Dispose(); + StopServer(); var folderPath = Path.Combine(deploymentResult.DeploymentResult.ContentRoot, @"logs"); diff --git a/test/IISIntegration.FunctionalTests/Inprocess/StartupExceptionTests.cs b/test/IISIntegration.FunctionalTests/Inprocess/StartupExceptionTests.cs index 79b92c3424..d82877d20c 100644 --- a/test/IISIntegration.FunctionalTests/Inprocess/StartupExceptionTests.cs +++ b/test/IISIntegration.FunctionalTests/Inprocess/StartupExceptionTests.cs @@ -29,6 +29,8 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests Assert.Equal(HttpStatusCode.InternalServerError, response.StatusCode); + StopServer(); + Assert.Contains(TestSink.Writes, context => context.Message.Contains($"Random number: {randomNumberString}")); } @@ -48,6 +50,8 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests Assert.Equal(HttpStatusCode.InternalServerError, response.StatusCode); + StopServer(); + Assert.Contains(TestSink.Writes, context => context.Message.Contains(new string('a', 4096))); } } diff --git a/test/IISIntegration.FunctionalTests/Inprocess/StartupTests.cs b/test/IISIntegration.FunctionalTests/Inprocess/StartupTests.cs index c470e12360..2f36110c90 100644 --- a/test/IISIntegration.FunctionalTests/Inprocess/StartupTests.cs +++ b/test/IISIntegration.FunctionalTests/Inprocess/StartupTests.cs @@ -126,6 +126,9 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests var deploymentResult = await DeployAsync(GetBaseDeploymentParameters("OverriddenServerWebSite")); var response = await deploymentResult.HttpClient.GetAsync("/"); Assert.False(response.IsSuccessStatusCode); + + StopServer(); + Assert.Contains(TestSink.Writes, context => context.Message.Contains("Application is running inside IIS process but is not configured to use IIS server")); } diff --git a/test/IISIntegration.FunctionalTests/OutOfProcess/GlobalVersionTests.cs b/test/IISIntegration.FunctionalTests/OutOfProcess/GlobalVersionTests.cs index dfeefd3d8b..2bef2b3c16 100644 --- a/test/IISIntegration.FunctionalTests/OutOfProcess/GlobalVersionTests.cs +++ b/test/IISIntegration.FunctionalTests/OutOfProcess/GlobalVersionTests.cs @@ -119,7 +119,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests Assert.Equal(_helloWorldResponse, responseText); - Dispose(); + StopServer(); deploymentResult = await DeployAsync(deploymentParameters); diff --git a/test/IISIntegration.FunctionalTests/Utilities/FunctionalTestsBase.cs b/test/IISIntegration.FunctionalTests/Utilities/FunctionalTestsBase.cs index 7817fd661f..1e739b645a 100644 --- a/test/IISIntegration.FunctionalTests/Utilities/FunctionalTestsBase.cs +++ b/test/IISIntegration.FunctionalTests/Utilities/FunctionalTestsBase.cs @@ -32,8 +32,14 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting } public override void Dispose() + { + StopServer(); + } + + public void StopServer() { _deployer?.Dispose(); + _deployer = null; } } }