test(metrics): the rollup test checks its own bucket, not the table's count (#5752)
CI / lint (push) Successful in 2s
CI / integration (push) Successful in 1m18s
CI / unit (push) Successful in 1m27s
CI / publish (push) Successful in 1m20s

#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 <noreply@anthropic.com>
This commit is contained in:
2026-10-14 14:41:59 -04:00
co-authored by Claude Opus 5.5
parent 5a0e150789
commit cd17def3ba
+5 -2
View File
@@ -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