Skip to content

Commit 8ef752c

Browse files
restore test
1 parent bdfe96e commit 8ef752c

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

tests/integrations/rust_tracing/test_rust_tracing.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff 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+
196215
def test_on_event_exception(
197216
sentry_init,
198217
capture_items,

0 commit comments

Comments
 (0)