Skip to content

Commit cb67c01

Browse files
committed
ci: Add rerun failures package for flaky tests
Signed-off-by: Cagri Yonca <cagri@ibm.com>
1 parent 3f9798d commit cb67c01

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ dev = [
6262
"pytest",
6363
"pytest-cov",
6464
"pytest-mock",
65+
"pytest-rerunfailures",
6566
"pre-commit>=3.0.0",
6667
"ruff"
6768
]

tests/clients/test_urllib3.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,23 @@
1010
import pytest
1111
import requests
1212
import urllib3
13+
14+
import tests.apps.flask_app # noqa: F401
1315
from instana.instrumentation.urllib3 import (
1416
_collect_kvs as collect_kvs,
15-
extract_custom_headers,
17+
)
18+
from instana.instrumentation.urllib3 import (
1619
collect_response,
20+
extract_custom_headers,
1721
)
1822
from instana.singletons import agent, tracer
19-
20-
import tests.apps.flask_app # noqa: F401
2123
from tests.helpers import testenv
2224

2325
if TYPE_CHECKING:
24-
from instana.span.span import InstanaSpan
2526
from pytest import LogCaptureFixture
2627

28+
from instana.span.span import InstanaSpan
29+
2730

2831
class TestUrllib3:
2932
@pytest.fixture(autouse=True)
@@ -136,6 +139,7 @@ def test_get_request(self):
136139
assert isinstance(urllib3_span.stack, list)
137140
assert len(urllib3_span.stack) > 1
138141

142+
@pytest.mark.flaky(reruns=3, reruns_delay=2)
139143
def test_get_request_https(self):
140144
request_url = "https://jsonplaceholder.typicode.com:443/todos/1"
141145
with tracer.start_as_current_span("test"):

0 commit comments

Comments
 (0)