test(autopilot-fanout): use relative timestamp inside freshness window

The 'end-to-end: updateSourceConfig persists timestamp visible to next
listAllSources' test pinned last_full_cycle_at to a hardcoded
'2026-05-22T15:00:00.000Z'. The 60-minute freshness window passed
within ~1 hour of write — every run after the deadline classified the
source as stale and dispatched it, breaking the test's
.skippedFresh expectation.

Switch to Date.now() - 30min relative timestamp (mirrors the prior
'source with last_full_cycle_at < 60min ago is skipped by gate' test).

Surfaced during fix-wave: warm-narwhal E2E gate.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Garry Tan
2026-05-24 12:02:43 -07:00
co-authored by Claude Opus 4.7
parent 23cd9d44ad
commit a34971af2a
+4 -1
View File
@@ -144,7 +144,10 @@ describeIfDB('autopilot fan-out — Postgres E2E', () => {
await seedSource('full-round-trip');
await engine.executeRaw(`UPDATE sources SET local_path = NULL WHERE id = 'default'`);
const ts = '2026-05-22T15:00:00.000Z';
// Relative timestamp inside the 60-min freshness window. A prior version
// pinned this to '2026-05-22T15:00:00.000Z' which started failing once
// wall-clock drifted past 60 minutes from that point.
const ts = new Date(Date.now() - 30 * 60 * 1000).toISOString();
const updated = await engine.updateSourceConfig('full-round-trip', {
last_full_cycle_at: ts,
});