Bifrost/tests/fake-clock.mjs
Meta Vens 0312e8bbac Watchdog notice reader: a future stamp is eligible now; no production clock seam
A failed entry stamped ahead of the clock (host clock stepped forward then
corrected) is eligible now instead of waiting out the skew; the next attempt
rewrites the stamp. The WATCHDOG_NOTICE_NOW_MS env var is deleted: the reader
reads Date.now(), and tests fix it with a --import preload (tests/fake-clock.mjs).
The unknown-entry tests now rerun far past the backoff so a retried unknown fails.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-01 02:19:01 +02:00

5 lines
178 B
JavaScript

// Test preload: fixes Date.now() to FAKE_NOW_MS when a test sets it.
if (process.env.FAKE_NOW_MS) {
const fixed = Number(process.env.FAKE_NOW_MS);
Date.now = () => fixed;
}