From 3eab45c5d8a03bfa9e7513214f83827f6c16cc84 Mon Sep 17 00:00:00 2001 From: Tim Orling Date: Fri, 1 Mar 2024 22:20:56 -0800 Subject: [PATCH] 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 * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Signed-off-by: Tim Orling Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- conftest.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/conftest.py b/conftest.py index 144e5f3e..4ca53847 100644 --- a/conftest.py +++ b/conftest.py @@ -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")