diff --git a/pyproject.toml b/pyproject.toml index 1f12cb6e..81eb0838 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -62,6 +62,7 @@ dev = [ "pytest", "pytest-cov", "pytest-mock", + "pytest-rerunfailures", "pre-commit>=3.0.0", "ruff" ] diff --git a/tests/clients/test_urllib3.py b/tests/clients/test_urllib3.py index 62b07d49..5670ddcf 100644 --- a/tests/clients/test_urllib3.py +++ b/tests/clients/test_urllib3.py @@ -10,20 +10,23 @@ import pytest import requests import urllib3 + +import tests.apps.flask_app # noqa: F401 from instana.instrumentation.urllib3 import ( _collect_kvs as collect_kvs, - extract_custom_headers, +) +from instana.instrumentation.urllib3 import ( collect_response, + extract_custom_headers, ) from instana.singletons import agent, tracer - -import tests.apps.flask_app # noqa: F401 from tests.helpers import testenv if TYPE_CHECKING: - from instana.span.span import InstanaSpan from pytest import LogCaptureFixture + from instana.span.span import InstanaSpan + class TestUrllib3: @pytest.fixture(autouse=True) @@ -136,6 +139,7 @@ def test_get_request(self): assert isinstance(urllib3_span.stack, list) assert len(urllib3_span.stack) > 1 + @pytest.mark.flaky(reruns=3, reruns_delay=2) def test_get_request_https(self): request_url = "https://jsonplaceholder.typicode.com:443/todos/1" with tracer.start_as_current_span("test"):