Skip to content

Commit 23e99c7

Browse files
committed
Nicer test output in case it is failing
1 parent 31f48e7 commit 23e99c7

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

sentry_sdk/integrations/celery/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,7 @@ def _inner(*args, **kwargs):
312312
# Celery task objects are not a thing to be trusted. Even
313313
# something such as attribute access can fail.
314314
headers = args[3].get("headers") or {}
315+
import ipdb; ipdb.set_trace()
315316
with sentry_sdk.continue_trace(headers):
316317
with sentry_sdk.start_span(
317318
op=OP.QUEUE_TASK_CELERY,

tests/integrations/celery/test_celery.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -543,20 +543,20 @@ def dummy_task(self, message):
543543
return trace_id
544544

545545
with sentry_sdk.start_span(name="task") as root_span:
546-
transaction_trace_id = root_span.trace_id
546+
root_span_trace_id = root_span.trace_id
547547

548548
# should propagate trace
549-
task_transaction_id = dummy_task.apply_async(
549+
task_trace_id = dummy_task.apply_async(
550550
args=("some message",),
551551
).get()
552-
assert transaction_trace_id == task_transaction_id
552+
assert root_span_trace_id == task_trace_id, "Trace should be propagated"
553553

554554
# should NOT propagate trace (overrides `propagate_traces` parameter in integration constructor)
555-
task_transaction_id = dummy_task.apply_async(
555+
task_trace_id = dummy_task.apply_async(
556556
args=("another message",),
557557
headers={"sentry-propagate-traces": False},
558558
).get()
559-
assert transaction_trace_id != task_transaction_id
559+
assert root_span_trace_id != task_trace_id, "Trace should NOT be propagated"
560560

561561

562562
def test_apply_async_manually_span(sentry_init):

0 commit comments

Comments
 (0)