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. https://github.com/HypothesisWorks/hypothesis/issues/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 <tim.orling@konsulko.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Signed-off-by: Tim Orling <tim.orling@konsulko.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
parent
69b6626046
commit
3eab45c5d8
|
@ -1,5 +1,7 @@
|
|||
# SPDX-License-Identifier: MIT
|
||||
|
||||
from datetime import timedelta
|
||||
|
||||
import pytest
|
||||
|
||||
from hypothesis import HealthCheck, settings
|
||||
|
@ -20,7 +22,11 @@ def _frozen(request):
|
|||
def pytest_configure(config):
|
||||
# HealthCheck.too_slow causes more trouble than good -- especially in CIs.
|
||||
settings.register_profile(
|
||||
"patience", settings(suppress_health_check=[HealthCheck.too_slow])
|
||||
"patience",
|
||||
settings(
|
||||
suppress_health_check=[HealthCheck.too_slow],
|
||||
deadline=timedelta(milliseconds=400),
|
||||
),
|
||||
)
|
||||
settings.load_profile("patience")
|
||||
|
||||
|
|
Loading…
Reference in New Issue