diff --git a/src/allmydata/test/__init__.py b/src/allmydata/test/__init__.py index 625d04230..304a81df9 100644 --- a/src/allmydata/test/__init__.py +++ b/src/allmydata/test/__init__.py @@ -25,6 +25,34 @@ def disable_foolscap_incidents(): # we disable incident reporting for all unit tests. disable_foolscap_incidents() + +def _configure_hypothesis(): + from os import environ + + from hypothesis import ( + HealthCheck, + settings, + ) + + settings.register_profile( + "ci", + suppress_health_check=[ + # CPU resources available to CI builds typically varies + # significantly from run to run making it difficult to determine + # if "too slow" data generation is a result of the code or the + # execution environment. Prevent these checks from + # (intermittently) failing tests that are otherwise fine. + HealthCheck.too_slow, + ], + # With the same reasoning, disable the test deadline. + deadline=None, + ) + + profile_name = environ.get("TXKUBE_HYPOTHESIS_PROFILE", "default") + settings.load_profile(profile_name) +_configure_hypothesis() + + import sys if sys.platform == "win32": from allmydata.windows.fixups import initialize