From 8099277e4d4674c9fa22a2132d507b7f117a5aab Mon Sep 17 00:00:00 2001 From: Stephen Halter Date: Mon, 22 Apr 2024 15:07:42 -0700 Subject: [PATCH] Quarantine HeartbeatLoopRunsWithSpecifiedInterval --- src/Servers/Kestrel/Core/test/HeartbeatTests.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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) {