Skip to content

Commit a434167

Browse files
committed
test(tracing): Update streaming tests for skipped orphan span creation
Align the rust_tracing and grpc aio streaming tests with the new behavior where no root segment is created when there is no active span in the streaming path.
1 parent ebcf1e2 commit a434167

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

tests/integrations/grpc/test_grpc_aio.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ async def test_noop_for_unimplemented_method(
100100

101101
sentry_sdk.flush()
102102
spans = [item.payload for item in items]
103-
assert len(spans) == 1 # Only client span present.
103+
assert len(spans) == 0 # No client span created without an active span.
104104
else:
105105
events = capture_events()
106106

tests/integrations/rust_tracing/test_rust_tracing.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -309,10 +309,10 @@ def test_on_new_span_without_transaction(sentry_init, span_streaming):
309309
if span_streaming:
310310
assert sentry_sdk.traces.get_current_span() is None
311311

312+
# In streaming mode we do not create an orphan root segment when there
313+
# is no active span
312314
rust_tracing.new_span(RustTracingLevel.Info, 3)
313-
current_span = sentry_sdk.traces.get_current_span()
314-
assert current_span is not None
315-
assert current_span._segment is current_span
315+
assert sentry_sdk.traces.get_current_span() is None
316316
else:
317317
assert sentry_sdk.get_current_span() is None
318318

0 commit comments

Comments
 (0)