From 02c225b6c86fec9e4e99c6c67d7e594a15e34ac4 Mon Sep 17 00:00:00 2001 From: Riya Chakraborty <47572810+ayirr7@users.noreply.github.com> Date: Tue, 14 May 2024 09:26:57 -0700 Subject: [PATCH] fix(CI): Make timestamp relative for metrics summaries test (#5904) * make timestamp relative * fix * seconds not minutes --- .../processors/test_metrics_summaries_processor.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/datasets/processors/test_metrics_summaries_processor.py b/tests/datasets/processors/test_metrics_summaries_processor.py index 674c636ef3..61675c438e 100644 --- a/tests/datasets/processors/test_metrics_summaries_processor.py +++ b/tests/datasets/processors/test_metrics_summaries_processor.py @@ -1,4 +1,4 @@ -from datetime import datetime +from datetime import datetime, timedelta from typing import Any, Mapping, Sequence import pytest @@ -17,18 +17,24 @@ def build_metrics_summary_payload() -> MetricsSummary: + + received_timestamp = datetime.timestamp( + datetime.now() - timedelta(days=1) - timedelta(seconds=5) + ) + end_timestamp = datetime.timestamp(datetime.now() - timedelta(days=1)) + return MetricsSummary( { "count": 1, "duration_ms": 1000, - "end_timestamp": 1707862430.123, + "end_timestamp": end_timestamp, "group": "deadbeefdeadbeef", "is_segment": False, "max": 1.0, "min": 1.0, "mri": "t:namespace/name@unit", "project_id": 42, - "received": 1707862428.123, + "received": received_timestamp, "retention_days": 90, "segment_id": "deadbeefdeadbeef", "span_id": "deadbeefdeadbeef",