Skip to content

Commit

Permalink
test(celery): Add test for retry count
Browse files Browse the repository at this point in the history
Add a test that ensures the retry count is set on the Celery task span. This test only tests a retry count of zero.
  • Loading branch information
szokeasaurusrex committed Apr 24, 2024
1 parent 5abdf3b commit 57bd97e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/integrations/celery/test_celery.py
Expand Up @@ -616,3 +616,17 @@ def example_task():
pytest.fail("Calling `apply_async` without arguments raised a TypeError")

assert result.get() == "success"


def test_retry_count(init_celery, capture_events):
celery = init_celery(enable_tracing=True)
events = capture_events()

@celery.task()
def task(): ...

task.apply_async()

(event,) = events
(span,) = event["spans"]
assert span["data"]["messaging.message.retry.count"] == 0

0 comments on commit 57bd97e

Please sign in to comment.