From 80baa39ef7dff2445c666881b001332f5338e4c4 Mon Sep 17 00:00:00 2001 From: Erik Darling <2136037+erikdarlingdata@users.noreply.github.com> Date: Sun, 11 Oct 2026 11:16:31 -0400 Subject: [PATCH] Pin the late-row fixed-clock test to today's date, not 2026-10-07 (#5661) The V168 late-row trigger only marks rows 1 to 17 days before the database's now(), so the pinned date aged out of its reach. The cases now use today's UTC date plus their hour and minute. --- .../PlanRegressionBuiltDaysFallbackLiveTests.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Darling/Darling.Tests/PlanRegressionBuiltDaysFallbackLiveTests.cs b/Darling/Darling.Tests/PlanRegressionBuiltDaysFallbackLiveTests.cs index 82e5b64c05..b07756cd38 100644 --- a/Darling/Darling.Tests/PlanRegressionBuiltDaysFallbackLiveTests.cs +++ b/Darling/Darling.Tests/PlanRegressionBuiltDaysFallbackLiveTests.cs @@ -138,9 +138,12 @@ public async Task ADailyTotalsChange_BetweenTheBuiltDaysReadAndTheDailyRead_IsNo public Task ADayMarkedByALateRow_DropsOutOfTheBuiltDays_AndIsReadLive() => RunLateRowAsync(utcNow: null); /// - /// The same assertions at a fixed clock, so the late-row test means the same all day. Before 04:00 UTC the window's start - /// (four hours back) is on the previous calendar day, so the window's first day is fifteen days before today; from 04:00 - /// UTC it is fourteen. The cases straddle that edge (the last minute before 04:00, and 04:00 itself) and a mid-day one. + /// The same assertions at a fixed time of day, so the late-row test means the same all day. Before 04:00 UTC the window's + /// start (four hours back) is on the previous calendar day, so the window's first day is fifteen days before today; from + /// 04:00 UTC it is fourteen. The cases straddle that edge (the last minute before 04:00, and 04:00 itself) and a mid-day + /// one. The date is today's (read once), not a pinned calendar day: the late-row trigger windows on the database's own + /// now() (it marks a row only 1 to 17 days old), so a pinned date ages out of that reach and the trigger skips the + /// row (#5661). The hour and minute are what the case pins. /// [Theory] [InlineData(0, 30)] @@ -148,7 +151,7 @@ public async Task ADailyTotalsChange_BetweenTheBuiltDaysReadAndTheDailyRead_IsNo [InlineData(4, 0)] [InlineData(12, 0)] public Task ADayMarkedByALateRow_DropsOutOfTheBuiltDays_AndIsReadLive_AtAFixedClock(int hour, int minute) => - RunLateRowAsync(new DateTime(2026, 10, 7, hour, minute, 0, DateTimeKind.Utc)); + RunLateRowAsync(DateTime.SpecifyKind(DateTime.UtcNow.Date, DateTimeKind.Utc).AddHours(hour).AddMinutes(minute)); private static async Task RunLateRowAsync(DateTime? utcNow) {