diff --git a/tests/test_services_retrieval_telemetry.py b/tests/test_services_retrieval_telemetry.py index 709840f..8605e39 100644 --- a/tests/test_services_retrieval_telemetry.py +++ b/tests/test_services_retrieval_telemetry.py @@ -706,11 +706,19 @@ async def test_coverage_is_per_source_because_the_table_is_older_than_its_arms( UID = 990077 now = datetime.now(timezone.utc) async with async_session() as s: - # An old surface, recording since well before any window we ask for. + # An old surface, recording since well before any window we ask for, + # AND still recording inside it. Both rows are needed: `complete_from` + # comes from the all-time query, but a source only gets a bucket at all + # if it has rows in the window, so the 90-day row alone would leave + # nothing to assert on. s.add(RetrievalLog( user_id=UID, source="auto_inject", result_count=1, created_at=now - timedelta(days=90), )) + s.add(RetrievalLog( + user_id=UID, source="auto_inject", result_count=1, + created_at=now - timedelta(days=1), + )) # A young arm, first written INSIDE the window below. s.add(RetrievalLog( user_id=UID, source="pre_tool_rule", result_count=1,