Skip to content

Commit e6a0cc8

Browse files
authored
Don't use diagnostics memory pool in GracefulTurnsAbortiveIfRequestsDoNotFinish (#56281)
1 parent ac9f980 commit e6a0cc8

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

src/Servers/Kestrel/test/FunctionalTests/Http2/ShutdownTests.cs

+3-13
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,16 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
using System;
5-
using System.Collections.Generic;
4+
using System.Buffers;
65
using System.Net;
76
using System.Net.Http;
87
using System.Security.Cryptography.X509Certificates;
9-
using System.Threading;
10-
using System.Threading.Tasks;
118
using Microsoft.AspNetCore.Hosting;
129
using Microsoft.AspNetCore.Http;
10+
using Microsoft.AspNetCore.InternalTesting;
1311
using Microsoft.AspNetCore.Server.Kestrel.Core;
1412
using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2;
15-
using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure;
1613
using Microsoft.AspNetCore.Server.Kestrel.FunctionalTests;
17-
using Microsoft.AspNetCore.InternalTesting;
18-
using Moq;
19-
using Xunit;
2014

2115
#if SOCKETS
2216
namespace Microsoft.AspNetCore.Server.Kestrel.Sockets.FunctionalTests.Http2;
@@ -173,11 +167,9 @@ public async Task GracefulTurnsAbortiveIfRequestsDoNotFinish()
173167
var requestStarted = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously);
174168
var requestUnblocked = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously);
175169

176-
var memoryPoolFactory = new DiagnosticMemoryPoolFactory(allowLateReturn: true);
177-
178170
var testContext = new TestServiceContext(LoggerFactory)
179171
{
180-
MemoryPoolFactory = memoryPoolFactory.Create
172+
MemoryPoolFactory = () => new PinnedBlockMemoryPool()
181173
};
182174

183175
ThrowOnUngracefulShutdown = false;
@@ -227,7 +219,5 @@ public async Task GracefulTurnsAbortiveIfRequestsDoNotFinish()
227219
Assert.Contains(LogMessages, m => m.Message.Contains("is closed. The last processed stream ID was 1."));
228220
Assert.Contains(LogMessages, m => m.Message.Contains("Some connections failed to close gracefully during server shutdown."));
229221
Assert.DoesNotContain(LogMessages, m => m.Message.Contains("Request finished in"));
230-
231-
await memoryPoolFactory.WhenAllBlocksReturned(TestConstants.DefaultTimeout);
232222
}
233223
}

0 commit comments

Comments
 (0)