From cd17def3ba818d2349eb072b63ce69e720dfd7e2 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Wed, 14 Oct 2026 14:41:59 -0400 Subject: [PATCH] test(metrics): the rollup test checks its own bucket, not the table's count (#5752) #5752 "Container CPU and memory history lives in the one metric store". Docker persist now records each snapshot at its own time, so test_docker's June and early-October snapshots leave raw plugin_metrics rows older than the 7-day window, and the rollup's table-wide counts include them (CI run 9119: 11 buckets, not 1). The test's own host is still checked exactly: one hourly row averaging 15 over 2 samples, and one raw sample left. Co-Authored-By: Claude Opus 5.5 --- tests/integration/test_host_metrics.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/integration/test_host_metrics.py b/tests/integration/test_host_metrics.py index be561aa..ee09572 100644 --- a/tests/integration/test_host_metrics.py +++ b/tests/integration/test_host_metrics.py @@ -120,8 +120,11 @@ def test_rollup_aggregates_old_raw_and_prunes(app): return counts, hrly, raw_left counts, hrly, raw_left = asyncio.run(_go()) - assert counts["buckets_rolled"] == 1 - assert counts["raw_rows_rolled"] == 2 + # The counts span the whole table, which other tests share (docker + # snapshots are recorded at their own, older times, #5752): this host's + # bucket is checked exactly below. + assert counts["buckets_rolled"] >= 1 + assert counts["raw_rows_rolled"] >= 2 assert len(hrly) == 1 assert abs(float(hrly[0][0]) - 15.0) < 0.001 # avg(10, 20) assert hrly[0][1] == 2