Skip to content

Commit 8f389b8

Browse files
committed
Tweaks
1 parent 26fb918 commit 8f389b8

File tree

3 files changed

+23
-12
lines changed

3 files changed

+23
-12
lines changed

hypothesis-python/RELEASE-sample.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ which should:
2525
- :func:`package.function` for link to functions, where the link text will
2626
be ``package.function``, or :func:`~package.function` to show ``function``.
2727
- :class:`package.class` for link to classes (abbreviated as above).
28-
- :issue:`issue-number` for referencing issues or :pull:`pr-number` for PRs.
28+
- :issue:`issue-number` for referencing issues.
29+
- Similarly, :pull:`pr-number` can be used for PRs, but it's usually
30+
preferred to refer to version numbers such as :ref:`version 6.98.9 <v6.98.9>,
31+
as they are meaningful to end users.
2932
- :doc:`link text <chapter#anchor>` for documentation references.
3033
- `link text <https://hypothesis.readthedocs.io/en/latest/chapter.html#anchor>`__
3134
is the same link, for general web addresses.

hypothesis-python/RELEASE.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
RELEASE_TYPE: patch
22

33
Account for time spent in garbage collection during tests, to avoid
4-
flaky ``DeadlineExceeded`` errors as seen in :issue:`3975`. Also fixes
5-
overcounting of stateful run times resulting from :issue:`3890`.
4+
flaky ``DeadlineExceeded`` errors as seen in :issue:`3975`.
5+
6+
Also fixes overcounting of stateful run times,
7+
a minor observability bug dating to :ref:`version 6.98.9 <v6.98.9>`
8+
(:issue:`3890`).

hypothesis-python/tests/nocover/test_recursive.py

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -195,10 +195,11 @@ def test_gc_hooks_do_not_cause_unraisable_recursionerror():
195195

196196
# This test is potentially flaky, because the stack usage of a function is not
197197
# constant. Regardless, if the test passes just once that's sufficient proof that
198-
# it's not the GC (or accounting of it) that is at fault.
198+
# it's not the GC (or accounting of it) that is at fault. Note, I haven't actually
199+
# seen it fail/flake, but I believe it could happen in principle.
199200

200-
# The number of cycles sufficient to reliably trigger a GC cycle, experimentally
201-
# found to be a few hundred on CPython. Multiply by 10 for safety margin.
201+
# The number of cycles sufficient to reliably trigger GC, experimentally found
202+
# to be a few hundred on CPython. Multiply by 10 for safety margin.
202203
NUM_CYCLES = 5_000
203204

204205
def probe_depth():
@@ -251,12 +252,16 @@ def inner_test(_):
251252
max_depth -= 1
252253
else:
253254
break
254-
# Note that PyPy is a bit weird, in that it raises RecursionError at
255-
# (maxdepth - n) for small positive n, but not at exactly (maxdepth).
256-
# In general, it is really finicky to get the details right in this
257-
# test, so be careful.
258-
259-
# Now check that the limit is unchanged with gc enabled
255+
# Note that PyPy is a bit weird, in that it raises RecursionError at
256+
# (maxdepth - n) for small positive n, but not at exactly (maxdepth).
257+
# In general, it is really finicky to get the details right in this
258+
# test, so be careful.
259+
260+
# Now check that the limit is unchanged with gc enabled, and also that
261+
# leaving a few frames for the callbacks does not fail.
262+
if hasattr(gc, "callbacks"): # see comment above
263+
for n in range(1, 4):
264+
gen_cycles_at_depth(max_depth - n, gc_disable=False)
260265
gen_cycles_at_depth(max_depth, gc_disable=False)
261266
with pytest.raises(RecursionError):
262267
gen_cycles_at_depth(max_depth + 1, gc_disable=False)

0 commit comments

Comments
 (0)