Increase shutdown timeout in Kestrel's other TestServer (#8011)
This commit is contained in:
parent
f5b6039add
commit
896c027010
|
|
@ -91,6 +91,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests
|
||||||
configureServices(services);
|
configureServices(services);
|
||||||
})
|
})
|
||||||
.UseSetting(WebHostDefaults.ApplicationKey, typeof(TestServer).GetTypeInfo().Assembly.FullName)
|
.UseSetting(WebHostDefaults.ApplicationKey, typeof(TestServer).GetTypeInfo().Assembly.FullName)
|
||||||
|
.UseSetting(WebHostDefaults.ShutdownTimeoutKey, TestConstants.DefaultTimeout.TotalSeconds.ToString())
|
||||||
.Build();
|
.Build();
|
||||||
|
|
||||||
_host.Start();
|
_host.Start();
|
||||||
|
|
|
||||||
|
|
@ -151,12 +151,13 @@ namespace Microsoft.AspNetCore.Server.Kestrel.InMemory.FunctionalTests
|
||||||
|
|
||||||
var stopTask = Task.CompletedTask;
|
var stopTask = Task.CompletedTask;
|
||||||
using (var server = new TestServer(requestDelegate, serviceContext, listenOptions))
|
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())
|
using (var connection = server.CreateConnection())
|
||||||
{
|
{
|
||||||
// Use the default 5 second shutdown timeout. If it hangs that long, we'll look
|
// We assume all CI servers are really slow, so we use a 30 second default test timeout
|
||||||
// at the collected memory dump.
|
// 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);
|
stopTask = server.StopAsync(shutdownCts.Token);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue