Skip to content

Commit 34cf8cf

Browse files
committed
Remove hypo deadlines for slow CI runners.
1 parent 2768701 commit 34cf8cf

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/py/tests/conftest.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11
import logging
2+
import os
3+
import platform
24

35
import logistro
46
import pytest
7+
from hypothesis import HealthCheck, settings
58

69
_logger = logistro.getLogger(__name__)
710

11+
settings.register_profile(
12+
"ci",
13+
deadline=None, # no per-example deadline
14+
suppress_health_check=(HealthCheck.too_slow,), # avoid flaky "too slow" on CI
15+
)
16+
817

918
# pytest shuts down its capture before logging/threads finish
1019
@pytest.fixture(scope="session", autouse=True)
@@ -19,3 +28,8 @@ def cleanup_logging_handlers(request):
1928
handler.flush()
2029
if isinstance(handler, logging.StreamHandler):
2130
logging.root.removeHandler(handler)
31+
32+
33+
is_ci = os.getenv("GITHUB_ACTIONS") == "true" or os.getenv("CI") == "true"
34+
if is_ci and platform.system in {"Windows", "Darwin"}:
35+
settings.load_profile("ci")

0 commit comments

Comments
 (0)