44from sentry_sdk .envelope import Envelope , Item , PayloadRef
55from sentry_relay .consts import DataCategory
66
7- from .asserts import time_within_delta , time_within
7+ from .asserts import time_within_delta , time_within , time_is
88
99from .test_dynamic_sampling import _add_sampling_config
1010
@@ -125,8 +125,8 @@ def test_spansv2_basic(
125125 },
126126 "name" : "some op" ,
127127 "received" : time_within (ts ),
128- "start_timestamp" : time_within (ts ),
129- "end_timestamp" : time_within (ts .timestamp () + 0.5 ),
128+ "start_timestamp" : time_is (ts ),
129+ "end_timestamp" : time_is (ts .timestamp () + 0.5 ),
130130 "is_segment" : True ,
131131 "status" : "ok" ,
132132 "retention_days" : 42 ,
@@ -141,7 +141,7 @@ def test_spansv2_basic(
141141 "name" : "c:spans/count_per_root_project@none" ,
142142 "org_id" : 1 ,
143143 "project_id" : 42 ,
144- "received_at" : time_within_delta ( ),
144+ "received_at" : time_within ( ts , precision = "s" ),
145145 "retention_days" : 90 ,
146146 "tags" : {
147147 "decision" : "keep" ,
@@ -156,7 +156,7 @@ def test_spansv2_basic(
156156 "name" : "c:spans/usage@none" ,
157157 "org_id" : 1 ,
158158 "project_id" : 42 ,
159- "received_at" : time_within_delta ( ),
159+ "received_at" : time_within ( ts , precision = "s" ),
160160 "retention_days" : 90 ,
161161 "tags" : {},
162162 "timestamp" : time_within_delta (),
@@ -329,7 +329,7 @@ def test_spansv2_ds_sampled(
329329 "name" : "c:spans/count_per_root_project@none" ,
330330 "org_id" : 1 ,
331331 "project_id" : 43 ,
332- "received_at" : time_within_delta ( ),
332+ "received_at" : time_within ( ts , precision = "s" ),
333333 "retention_days" : 90 ,
334334 "tags" : {
335335 "decision" : "keep" ,
@@ -344,7 +344,7 @@ def test_spansv2_ds_sampled(
344344 "name" : "c:spans/usage@none" ,
345345 "org_id" : 1 ,
346346 "project_id" : 42 ,
347- "received_at" : time_within_delta ( ),
347+ "received_at" : time_within ( ts , precision = "s" ),
348348 "retention_days" : 90 ,
349349 "tags" : {},
350350 "timestamp" : time_within_delta (),
@@ -425,7 +425,7 @@ def test_spansv2_ds_root_in_different_org(
425425 "name" : "c:spans/count_per_root_project@none" ,
426426 "org_id" : 1 ,
427427 "project_id" : 42 ,
428- "received_at" : time_within_delta ( ),
428+ "received_at" : time_within ( ts , precision = "s" ),
429429 "retention_days" : 90 ,
430430 "tags" : {"decision" : "drop" , "target_project_id" : "42" },
431431 "timestamp" : time_within_delta (),
@@ -436,7 +436,7 @@ def test_spansv2_ds_root_in_different_org(
436436 "name" : "c:spans/usage@none" ,
437437 "org_id" : 1 ,
438438 "project_id" : 42 ,
439- "received_at" : time_within_delta ( ),
439+ "received_at" : time_within ( ts , precision = "s" ),
440440 "retention_days" : 90 ,
441441 "tags" : {},
442442 "timestamp" : time_within_delta (),
@@ -815,8 +815,8 @@ def test_spanv2_with_string_pii_scrubbing(
815815 },
816816 },
817817 "name" : "Test span" ,
818- "start_timestamp" : time_within (ts ),
819- "end_timestamp" : time_within (ts .timestamp () + 0.5 ),
818+ "start_timestamp" : time_is (ts ),
819+ "end_timestamp" : time_is (ts .timestamp () + 0.5 ),
820820 "is_segment" : False ,
821821 "status" : "ok" ,
822822 }
@@ -974,8 +974,8 @@ def test_spansv2_attribute_normalization(
974974 },
975975 "name" : "some op" ,
976976 "received" : time_within (ts ),
977- "start_timestamp" : time_within (ts ),
978- "end_timestamp" : time_within (ts .timestamp () + 0.5 ),
977+ "start_timestamp" : time_is (ts ),
978+ "end_timestamp" : time_is (ts .timestamp () + 0.5 ),
979979 "is_segment" : True ,
980980 "status" : "ok" ,
981981 "retention_days" : 42 ,
0 commit comments