Increase shutdown timeout in Kestrel's other TestServer (#8011)

This commit is contained in:
Stephen Halter 2019-02-27 18:15:25 -08:00 committed by GitHub
parent f5b6039add
commit 896c027010
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -91,6 +91,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests
configureServices(services);
})
.UseSetting(WebHostDefaults.ApplicationKey, typeof(TestServer).GetTypeInfo().Assembly.FullName)
.UseSetting(WebHostDefaults.ShutdownTimeoutKey, TestConstants.DefaultTimeout.TotalSeconds.ToString())
.Build();
_host.Start();

View File

@ -151,12 +151,13 @@ namespace Microsoft.AspNetCore.Server.Kestrel.InMemory.FunctionalTests
var stopTask = Task.CompletedTask;
using (var server = new TestServer(requestDelegate, serviceContext, listenOptions))
using (var shutdownCts = new CancellationTokenSource(TimeSpan.FromSeconds(5)))
using (var shutdownCts = new CancellationTokenSource(TestConstants.DefaultTimeout))
{
using (var connection = server.CreateConnection())
{
// Use the default 5 second shutdown timeout. If it hangs that long, we'll look
// at the collected memory dump.
// We assume all CI servers are really slow, so we use a 30 second default test timeout
// instead of the 5 second default production timeout. If this test is still flaky,
// *then* we can consider collecting and investigating memory dumps.
stopTask = server.StopAsync(shutdownCts.Token);
}