From 629c466fd92c1ab78aaccf5fab572494f0e58be9 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Tue, 6 Oct 2026 17:57:20 -0400 Subject: [PATCH] test(monitors): take "12 minutes ago" from the render's own clock (#5121) NOW is fixed when the module is imported; by the time the detail page rendered in CI seven seconds had passed, and |ago rightly said "12m 7s ago". The page was right; the test's clock was stale. Co-Authored-By: Claude Opus 5.5 --- tests/core/test_monitors_page.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/core/test_monitors_page.py b/tests/core/test_monitors_page.py index cf64530..b12f628 100644 --- a/tests/core/test_monitors_page.py +++ b/tests/core/test_monitors_page.py @@ -93,7 +93,7 @@ async def test_the_monitor_page_says_since_when_and_why(app): session["user_role"] = "admin" page = await render_template( "monitors/detail.html", monitor=m, host=None, latest=down, failures=[down], state="down", - since=NOW - timedelta(minutes=12), since_at_least=False, tls_days=None, + since=datetime.now(timezone.utc) - timedelta(minutes=12), since_at_least=False, tls_days=None, uptime={"24h": 93.0, "7d": None, "30d": 99.5}, heartbeat=[{"state": "up", "title": "a"}, {"state": "down", "title": "b"}]) assert 'Monitors' in page and "shop <api>" in page