Skip to content

Commit 267ee6c

Browse files
authored
test: Run tracing tests in stream mode (#7345)
Adapt tests of integrations we've already fully ported to span streaming so that they actually use span streaming everytime they define a `traces_sampler` or `traces_sample_rate`. Otherwise, they're implicitly using static tracing, and they'll break the moment we remove it. Note: there are at least two tests in `test_threading.py` that also need this change but I'll submit them separately because those will need additional changes.
1 parent c3c44b1 commit 267ee6c

4 files changed

Lines changed: 13 additions & 2 deletions

File tree

‎tests/integrations/boto3/test_trace_propagation.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ def test_presigned_urls_do_not_require_sentry_headers(sentry_init):
176176
traces_sample_rate=1.0,
177177
default_integrations=False,
178178
integrations=[Boto3Integration(), StdlibIntegration()],
179+
trace_lifecycle="stream",
179180
)
180181
client = boto3.client( # type: ignore[attr-defined]
181182
"s3",

‎tests/integrations/django/test_basic.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1514,6 +1514,7 @@ def test_render_spans_queryset_in_data(sentry_init, client, capture_events):
15141514
)
15151515
],
15161516
traces_sample_rate=1.0,
1517+
trace_lifecycle="stream",
15171518
)
15181519
events = capture_events()
15191520

‎tests/integrations/django/test_tasks.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ def test_task_enqueue_returns_result(sentry_init, immediate_backend):
9595
sentry_init(
9696
integrations=[DjangoIntegration()],
9797
traces_sample_rate=1.0,
98+
trace_lifecycle="stream",
9899
)
99100

100101
result = add_numbers.enqueue(3, 5)

‎tests/integrations/grpc/test_grpc.py‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,11 @@ def test_grpc_client_and_servers_interceptors_integration(
426426

427427
@pytest.mark.forked
428428
def test_stream_stream(sentry_init):
429-
sentry_init(traces_sample_rate=1.0, integrations=[GRPCIntegration()])
429+
sentry_init(
430+
traces_sample_rate=1.0,
431+
integrations=[GRPCIntegration()],
432+
trace_lifecycle="stream",
433+
)
430434
server, channel = _set_up()
431435

432436
# Use the provided channel
@@ -444,7 +448,11 @@ def test_stream_unary(sentry_init):
444448
Test to verify stream-stream works.
445449
Tracing not supported for it yet.
446450
"""
447-
sentry_init(traces_sample_rate=1.0, integrations=[GRPCIntegration()])
451+
sentry_init(
452+
traces_sample_rate=1.0,
453+
integrations=[GRPCIntegration()],
454+
trace_lifecycle="stream",
455+
)
448456
server, channel = _set_up()
449457

450458
# Use the provided channel

0 commit comments

Comments
 (0)