@@ -28,15 +28,13 @@ def inner(signal, f):
28
28
@pytest .fixture
29
29
def init_celery (sentry_init , request ):
30
30
def inner (
31
- propagate_traces = True ,
32
31
backend = "always_eager" ,
33
32
monitor_beat_tasks = False ,
34
33
** kwargs ,
35
34
):
36
35
sentry_init (
37
36
integrations = [
38
37
CeleryIntegration (
39
- propagate_traces = propagate_traces ,
40
38
monitor_beat_tasks = monitor_beat_tasks ,
41
39
)
42
40
],
@@ -267,24 +265,6 @@ def dummy_task():
267
265
assert not sentry_sdk .get_isolation_scope ()._tags
268
266
269
267
270
- def test_simple_no_propagation (capture_events , init_celery ):
271
- celery = init_celery (propagate_traces = False )
272
- events = capture_events ()
273
-
274
- @celery .task (name = "dummy_task" )
275
- def dummy_task ():
276
- 1 / 0
277
-
278
- with start_transaction () as transaction :
279
- dummy_task .delay ()
280
-
281
- (event ,) = events
282
- assert event ["contexts" ]["trace" ]["trace_id" ] != transaction .trace_id
283
- assert event ["transaction" ] == "dummy_task"
284
- (exception ,) = event ["exception" ]["values" ]
285
- assert exception ["type" ] == "ZeroDivisionError"
286
-
287
-
288
268
def test_ignore_expected (capture_events , celery ):
289
269
events = capture_events ()
290
270
@@ -532,9 +512,7 @@ def test_sentry_propagate_traces_override(init_celery):
532
512
Test if the `sentry-propagate-traces` header given to `apply_async`
533
513
overrides the `propagate_traces` parameter in the integration constructor.
534
514
"""
535
- celery = init_celery (
536
- propagate_traces = True , traces_sample_rate = 1.0 , release = "abcdef"
537
- )
515
+ celery = init_celery (traces_sample_rate = 1.0 , release = "abcdef" )
538
516
539
517
@celery .task (name = "dummy_task" , bind = True )
540
518
def dummy_task (self , message ):
@@ -550,13 +528,6 @@ def dummy_task(self, message):
550
528
).get ()
551
529
assert transaction_trace_id == task_transaction_id
552
530
553
- # should NOT propagate trace (overrides `propagate_traces` parameter in integration constructor)
554
- task_transaction_id = dummy_task .apply_async (
555
- args = ("another message" ,),
556
- headers = {"sentry-propagate-traces" : False },
557
- ).get ()
558
- assert transaction_trace_id != task_transaction_id
559
-
560
531
561
532
def test_apply_async_manually_span (sentry_init ):
562
533
sentry_init (
0 commit comments