Skip to content

Commit 10fdceb

Browse files
committed
fix(perf): retry tests in rare old CI machines
1 parent 21e1c5c commit 10fdceb

File tree

4 files changed

+24
-55
lines changed

4 files changed

+24
-55
lines changed

poetry.lock

Lines changed: 16 additions & 37 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ mypy-boto3-secretsmanager = "^1.24.0"
5959
mypy-boto3-ssm = "^1.24.0"
6060
mypy-boto3-appconfig = "^1.24.0"
6161
mypy-boto3-dynamodb = "^1.24.0"
62+
pytest-rerunfailures = "^10.2"
6263

6364

6465
[tool.poetry.extras]

tests/performance/conftest.py

Lines changed: 0 additions & 18 deletions
This file was deleted.

tests/performance/test_high_level_imports.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import importlib
2+
import os
23
import time
34
from contextlib import contextmanager
45
from types import ModuleType
@@ -11,6 +12,8 @@
1112
TRACER_INIT_SLA: float = 0.5
1213
IMPORT_INIT_SLA: float = 0.035
1314

15+
IS_CI = os.getenv("CI", False)
16+
1417

1518
@contextmanager
1619
def timing() -> Generator:
@@ -37,6 +40,7 @@ def core_utilities() -> Tuple[ModuleType, ModuleType, ModuleType]:
3740

3841

3942
@pytest.mark.perf
43+
@pytest.mark.flaky(reruns=1, condition=IS_CI)
4044
def test_import_times_ceiling():
4145
# GIVEN Core utilities are imported
4246
# WHEN none are used
@@ -52,6 +56,7 @@ def test_import_times_ceiling():
5256

5357

5458
@pytest.mark.perf
59+
@pytest.mark.flaky(reruns=1, reruns_delay=1, condition=IS_CI)
5560
def test_tracer_init():
5661
# GIVEN Tracer is initialized
5762
# WHEN default options are used
@@ -68,6 +73,7 @@ def test_tracer_init():
6873

6974

7075
@pytest.mark.perf
76+
@pytest.mark.flaky(reruns=1, reruns_delay=1, condition=IS_CI)
7177
def test_metrics_init():
7278
# GIVEN Metrics is initialized
7379
# WHEN default options are used
@@ -82,6 +88,7 @@ def test_metrics_init():
8288

8389

8490
@pytest.mark.perf
91+
@pytest.mark.flaky(reruns=1, reruns_delay=1, condition=IS_CI)
8592
def test_logger_init():
8693
# GIVEN Logger is initialized
8794
# WHEN default options are used

0 commit comments

Comments
 (0)