Dispose server before checking test sink (#940)
This commit is contained in:
parent
b24a838301
commit
a159cadf18
|
|
@ -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");
|
||||
|
||||
|
|
|
|||
|
|
@ -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)));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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"));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
|||
|
||||
Assert.Equal(_helloWorldResponse, responseText);
|
||||
|
||||
Dispose();
|
||||
StopServer();
|
||||
|
||||
deploymentResult = await DeployAsync(deploymentParameters);
|
||||
|
||||
|
|
|
|||
|
|
@ -32,8 +32,14 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting
|
|||
}
|
||||
|
||||
public override void Dispose()
|
||||
{
|
||||
StopServer();
|
||||
}
|
||||
|
||||
public void StopServer()
|
||||
{
|
||||
_deployer?.Dispose();
|
||||
_deployer = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue