Skip to content

Commit 3eab45c

Browse files
conftest.py: double Hypothesis deadline (#1252)
* conftest.py: double Hypothesis deadline The deadline is by default 200ms, but this is intended to be useful to the developer and not necessarily recommended for heavily loaded CI systems. Avoid warnings by doubling the deadline. If we continue to see problems, we can revisit disabling (deadline=None) or a longer deadline. HypothesisWorks/hypothesis#3713 https://hypothesis.readthedocs.io/en/latest/settings.html#hypothesis.settings.deadline https://lists.openembedded.org/g/openembedded-core/topic/104640034#196437 Fixes: """ Unreliable test timings! On an initial run, this test took 268.29ms, which exceeded the deadline of 200.00ms, but on a subsequent run it took 2.63 ms, which did not. If you expect this sort of variability in your test timings, consider turning deadlines off for this test by setting deadline=None. """ Signed-off-by: Tim Orling <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Signed-off-by: Tim Orling <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 69b6626 commit 3eab45c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

conftest.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# SPDX-License-Identifier: MIT
22

3+
from datetime import timedelta
4+
35
import pytest
46

57
from hypothesis import HealthCheck, settings
@@ -20,7 +22,11 @@ def _frozen(request):
2022
def pytest_configure(config):
2123
# HealthCheck.too_slow causes more trouble than good -- especially in CIs.
2224
settings.register_profile(
23-
"patience", settings(suppress_health_check=[HealthCheck.too_slow])
25+
"patience",
26+
settings(
27+
suppress_health_check=[HealthCheck.too_slow],
28+
deadline=timedelta(milliseconds=400),
29+
),
2430
)
2531
settings.load_profile("patience")
2632

0 commit comments

Comments
 (0)