File tree Expand file tree Collapse file tree
tests/integrations/rust_tracing Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -193,6 +193,25 @@ def test_nested_on_new_span_on_close(
193193 assert second_span_data ["version" ] == "None"
194194
195195
196+ def test_on_new_span_without_active_span (sentry_init ):
197+ rust_tracing = FakeRustTracing ()
198+ integration = RustTracingIntegration (
199+ "test_on_new_span_without_active_span" , rust_tracing .set_layer_impl
200+ )
201+ sentry_init (
202+ integrations = [integration ],
203+ traces_sample_rate = 1.0 ,
204+ trace_lifecycle = "stream" ,
205+ )
206+
207+ assert sentry_sdk .traces .get_current_span () is None
208+
209+ # In streaming mode we do not create an orphan root segment when there
210+ # is no active span
211+ rust_tracing .new_span (RustTracingLevel .Info , 3 )
212+ assert sentry_sdk .traces .get_current_span () is None
213+
214+
196215def test_on_event_exception (
197216 sentry_init ,
198217 capture_items ,
You can’t perform that action at this time.
0 commit comments