diff --git a/src/Servers/Kestrel/Core/test/HeartbeatTests.cs b/src/Servers/Kestrel/Core/test/HeartbeatTests.cs index f5e89d4503de..02062e71f00b 100644 --- a/src/Servers/Kestrel/Core/test/HeartbeatTests.cs +++ b/src/Servers/Kestrel/Core/test/HeartbeatTests.cs @@ -20,6 +20,7 @@ public void HeartbeatIntervalIsOneSecond() } [Fact] + [QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/55297")] public async void HeartbeatLoopRunsWithSpecifiedInterval() { var heartbeatCallCount = 0; @@ -38,7 +39,7 @@ public async void HeartbeatLoopRunsWithSpecifiedInterval() { sw = Stopwatch.StartNew(); } - else + else if (heartbeatCallCount <= 5) { var split = sw.Elapsed; splits.Add(split); @@ -47,6 +48,12 @@ public async void HeartbeatLoopRunsWithSpecifiedInterval() sw.Restart(); } + else + { + // If shutdown takes too long there could be more OnHeartbeat calls, but that shouldn't fail the test, + // so we ignore them. See https://github.com/dotnet/aspnetcore/issues/55297 + Logger.LogInformation("Extra OnHeartbeat call()."); + } if (heartbeatCallCount == 5) {