diff --git a/dev-requirements.txt b/dev-requirements.txt index 2bb9e32149..86e025189a 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -13,3 +13,4 @@ readme-renderer~=24.0 grpcio-tools==1.29.0 mypy-protobuf>=1.23 protobuf>=3.13.0 +flaky==3.7.0 diff --git a/tests/opentelemetry-docker-tests/tests/celery/test_celery_functional.py b/tests/opentelemetry-docker-tests/tests/celery/test_celery_functional.py index 45ffbbe389..615c1ea24b 100644 --- a/tests/opentelemetry-docker-tests/tests/celery/test_celery_functional.py +++ b/tests/opentelemetry-docker-tests/tests/celery/test_celery_functional.py @@ -14,7 +14,7 @@ import celery -import pytest +from pytest import mark from celery.exceptions import Retry import opentelemetry.instrumentation.celery @@ -33,7 +33,7 @@ class MyException(Exception): pass -@pytest.mark.skip(reason="inconsistent test results") +@mark.skip(reason="inconsistent test results") def test_instrumentation_info(celery_app, memory_exporter): @celery_app.task def fn_task(): @@ -143,7 +143,7 @@ def fn_task(self): assert span.attributes.get("celery.state") == "SUCCESS" -@pytest.mark.skip(reason="inconsistent test results") +@mark.skip(reason="inconsistent test results") def test_fn_task_apply_async(celery_app, memory_exporter): @celery_app.task def fn_task_parameters(user, force_logout=False): @@ -190,7 +190,7 @@ def fn_task_parameters(user, force_logout=False): ) -@pytest.mark.skip(reason="inconsistent test results") +@mark.skip(reason="inconsistent test results") def test_concurrent_delays(celery_app, memory_exporter): @celery_app.task def fn_task(): @@ -206,7 +206,7 @@ def fn_task(): assert len(spans) == 200 -@pytest.mark.skip(reason="inconsistent test results") +@mark.skip(reason="inconsistent test results") def test_fn_task_delay(celery_app, memory_exporter): @celery_app.task def fn_task_parameters(user, force_logout=False): @@ -476,7 +476,7 @@ def add(x, y): ) -@pytest.mark.skip(reason="inconsistent test results") +@mark.skip(reason="inconsistent test results") def test_apply_async_previous_style_tasks( celery_app, celery_worker, memory_exporter ): @@ -558,6 +558,8 @@ class CelerySubClass(CelerySuperClass): ) == async_run_span.attributes.get(SpanAttributes.MESSAGING_MESSAGE_ID) +# FIXME find a permanent solution for the flakiness of this test +@mark.flaky def test_custom_tracer_provider(celery_app, memory_exporter): @celery_app.task def fn_task():