From acafee06e2aa9d7a695636553a5d64cbb7b53ee4 Mon Sep 17 00:00:00 2001 From: Mikael Hugo Date: Sun, 17 May 2026 17:49:11 +0200 Subject: [PATCH] fix: iter-completion-reconciler test uses relative timestamps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Test had fixed literal timestamps (TS_X = "2026-05-17T12:42:05.618Z") that became stale once the calendar moved past them — the reconciler's default maxAgeMs (1h, "older drift is operator territory") filtered them out. By 3h after the original write the test failed: reconciled.length was 0 because no entry passed the age filter. Switch to NOW-relative timestamps (5/30/1 min back from Date.now()) so the fixture always lands inside the default age window regardless of when the test runs. Sonnet #13 (tool rename) report flagged this test as failing alongside the 4 known pre-existing failures. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../sf/tests/iter-completion-reconciler.test.mjs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/resources/extensions/sf/tests/iter-completion-reconciler.test.mjs b/src/resources/extensions/sf/tests/iter-completion-reconciler.test.mjs index fd2f97157..e3b336ea2 100644 --- a/src/resources/extensions/sf/tests/iter-completion-reconciler.test.mjs +++ b/src/resources/extensions/sf/tests/iter-completion-reconciler.test.mjs @@ -120,9 +120,14 @@ function makeMemDb() { }; } -const TS_X = "2026-05-17T12:42:05.618Z"; -const TS_OLDER = "2026-05-17T11:00:00.000Z"; -const TS_NEWER = "2026-05-17T14:00:00.000Z"; +// Test timestamps are computed relative to NOW so the reconciler's default +// maxAgeMs filter (1h — "older drift is operator territory") doesn't drop +// them as the calendar moves past the original literal timestamps. Tests +// that explicitly want stale entries pass their own past timestamp. +const NOW_MS = Date.now(); +const TS_X = new Date(NOW_MS - 5 * 60 * 1000).toISOString(); // 5 min ago +const TS_OLDER = new Date(NOW_MS - 30 * 60 * 1000).toISOString(); // 30 min ago +const TS_NEWER = new Date(NOW_MS - 1 * 60 * 1000).toISOString(); // 1 min ago // ─── Tests ──────────────────────────────────────────────────────────────────