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"): diff --git a/tests/requirements-minimal.txt b/tests/requirements-minimal.txt index a325691b..b8166302 100644 --- a/tests/requirements-minimal.txt +++ b/tests/requirements-minimal.txt @@ -1,3 +1,4 @@ coverage>=5.5 pytest>=4.6 setuptools +pytest-rerunfailures \ No newline at end of file