@@ -55,7 +55,7 @@ def test_monitor_unhealthy(sentry_init):
5555 assert monitor .downsample_factor == (i + 1 if i < 10 else 10 )
5656
5757
58- def test_transaction_uses_downsample_rate (
58+ def test_root_span_uses_downsample_rate (
5959 sentry_init , capture_envelopes , capture_record_lost_event_calls , monkeypatch
6060):
6161 sentry_init (
@@ -78,16 +78,14 @@ def test_transaction_uses_downsample_rate(
7878 assert monitor .is_healthy () is False
7979 assert monitor .downsample_factor == 1
8080
81- with sentry_sdk .start_transaction (name = "foobar" ) as transaction :
81+ with sentry_sdk .start_span (name = "foobar" ) as root_span :
8282 with sentry_sdk .start_span (name = "foospan" ):
8383 with sentry_sdk .start_span (name = "foospan2" ):
8484 with sentry_sdk .start_span (name = "foospan3" ):
8585 ...
8686
87- assert transaction .sampled is False
88- assert (
89- transaction .sample_rate == 0.5
90- ) # TODO: this fails until we put the sample_rate in the POTelSpan
87+ assert root_span .sampled is False
88+ assert root_span .sample_rate == 0.5
9189
9290 assert len (envelopes ) == 0
9391
@@ -104,7 +102,7 @@ def test_transaction_uses_downsample_rate(
104102 "span" ,
105103 None ,
106104 1 ,
107- ), # Only one span (the transaction itself) is counted, since we did not record any spans in the first place.
105+ ), # Only one span (the root span itself) is counted, since we did not record any spans in the first place.
108106 ]
109107 )
110108
0 commit comments