From f08da6663158eeb61c9db288bd78783e14933c5f Mon Sep 17 00:00:00 2001 From: Zac Hatfield-Dodds Date: Sat, 13 May 2023 22:39:05 -0700 Subject: [PATCH] gh-86275: Don't fail PBTs for running slowly --- Lib/test/support/hypothesis_helper.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Lib/test/support/hypothesis_helper.py b/Lib/test/support/hypothesis_helper.py index 76bd2490fe6e3d..a614923e81402b 100644 --- a/Lib/test/support/hypothesis_helper.py +++ b/Lib/test/support/hypothesis_helper.py @@ -2,3 +2,12 @@ import hypothesis except ImportError: from . import _hypothesis_stubs as hypothesis +else: + # When using the real Hypothesis, we'll configure it to ignore occasional + # slow tests (avoiding flakiness from random VM slowness in CI). + hypothesis.settings.register_profile( + "slow-is-ok", + deadline=None, + suppress_health_check=[hypothesis.HealthCheck.too_slow], + ) + hypothesis.settings.load_profile("slow-is-ok")