diff mbox series

[v2] python3-attrs: disable Hypothesis deadline

Message ID 20240229230025.3253330-1-tim.orling@konsulko.com
State Accepted, archived
Commit f6064e573b68104d57565c57bfe43f0d708a14f6
Headers show
Series [v2] python3-attrs: disable Hypothesis deadline | expand

Commit Message

Tim Orling Feb. 29, 2024, 11 p.m. UTC
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 disabling the deadline completely.

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
https://github.com/python-attrs/attrs/pull/1252

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.
"""

[YOCTO #15350]

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
---
Changes in v2:
* Reference Bugzilla #15350 which is HIGHLY likely to be related
* Change Upstream-Status to submitted, since the comments in conftest.py state
  it is setting up for CI situation. "patience" and deadline=None seem to go
  hand in hand :)

 .../0001-conftest.py-disable-deadline.patch   | 45 +++++++++++++++++++
 .../python/python3-attrs_23.2.0.bb            |  1 +
 2 files changed, 46 insertions(+)
 create mode 100644 meta/recipes-devtools/python/python3-attrs/0001-conftest.py-disable-deadline.patch
diff mbox series

Patch

diff --git a/meta/recipes-devtools/python/python3-attrs/0001-conftest.py-disable-deadline.patch b/meta/recipes-devtools/python/python3-attrs/0001-conftest.py-disable-deadline.patch
new file mode 100644
index 00000000000..b1e6d999168
--- /dev/null
+++ b/meta/recipes-devtools/python/python3-attrs/0001-conftest.py-disable-deadline.patch
@@ -0,0 +1,45 @@ 
+From 41103f017f6a233ebb477dd1712fe82ea8f1c84c Mon Sep 17 00:00:00 2001
+From: Tim Orling <tim.orling@konsulko.com>
+Date: Thu, 29 Feb 2024 08:45:54 -0800
+Subject: [PATCH] conftest.py: disable 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 disabling the deadline completely.
+
+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.
+"""
+
+Upstream-Status: Submitted [https://github.com/python-attrs/attrs/pull/1252]
+
+Signed-off-by: Tim Orling <tim.orling@konsulko.com>
+---
+ conftest.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/conftest.py b/conftest.py
+index 144e5f3..fdead3d 100644
+--- a/conftest.py
++++ b/conftest.py
+@@ -20,7 +20,7 @@ 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=None)
+     )
+     settings.load_profile("patience")
+ 
+-- 
+2.34.1
+
diff --git a/meta/recipes-devtools/python/python3-attrs_23.2.0.bb b/meta/recipes-devtools/python/python3-attrs_23.2.0.bb
index 3945798ba5e..a6380979884 100644
--- a/meta/recipes-devtools/python/python3-attrs_23.2.0.bb
+++ b/meta/recipes-devtools/python/python3-attrs_23.2.0.bb
@@ -9,6 +9,7 @@  inherit pypi ptest python_hatchling
 
 SRC_URI += " \
 	file://0001-test_funcs-skip-test_unknown-for-pytest-8.patch \
+	file://0001-conftest.py-disable-deadline.patch \
 	file://run-ptest \
 "