Source: python-hypothesis
Version: 6.92.2-1
Severity: important
Tags: ftbfs
Forwarded: https://github.com/HypothesisWorks/hypothesis/issues/3829

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Recently, I started to see intermittent test failures for 
test_can_produce_multi_line_strings in Debian package builds. I don't 
know if this is some sort of regression in version 6.92.2 or if this 
test has always been a bit flaky and merely became more likely to fail 
because Debian runs the test suite twice at the moment (Python 3.11 and 
Python 3.12).

Example failure for Python 3.11:
https://buildd.debian.org/status/fetch.php?pkg=python-hypothesis&arch=all&ver=6.92.2-1&stamp=1703980481&raw=0

_____________________ test_can_produce_multi_line_strings ______________________
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/_pytest/runner.py", line 341, in 
from_call
    result: Optional[TResult] = func()
                                ^^^^^^
  File "/usr/lib/python3/dist-packages/_pytest/runner.py", line 262, in <lambda>
    lambda: ihook(item=item, **kwds), when=when, reraise=reraise
            ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 493, in __call__
    return self._hookexec(self.name, self._hookimpls, kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 115, in 
_hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 152, in 
_multicall
    return outcome.get_result()
           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/pluggy/_result.py", line 114, in 
get_result
    raise exc.with_traceback(exc.__traceback__)
  File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 77, in 
_multicall
    res = hook_impl.function(*args)
          ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/_pytest/runner.py", line 177, in 
pytest_runtest_call
    raise e
  File "/usr/lib/python3/dist-packages/_pytest/runner.py", line 169, in 
pytest_runtest_call
    item.runtest()
  File "/usr/lib/python3/dist-packages/_pytest/python.py", line 1792, in runtest
    self.ihook.pytest_pyfunc_call(pyfuncitem=self)
  File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 493, in __call__
    return self._hookexec(self.name, self._hookimpls, kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 115, in 
_hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 113, in 
_multicall
    raise exception.with_traceback(exception.__traceback__)
  File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 77, in 
_multicall
    res = hook_impl.function(*args)
          ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/_pytest/python.py", line 194, in 
pytest_pyfunc_call
    result = testfunction(**testargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File 
"/<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_hypothesis/build/tests/quality/test_discovery_ability.py",
 line 118, in run_test
    raise HypothesisFalsified(
tests.quality.test_discovery_ability.HypothesisFalsified: P(lambda x: "\n" in 
x) ~ 47 / 98 = 0.48 < 0.50; rejected


Example failure for Python 3.12:
https://salsa.debian.org/python-team/packages/python-hypothesis/-/jobs/5108379

_____________________ test_can_produce_multi_line_strings ______________________
    def run_test():
        if condition is None:
    
            def _condition(x):
                return True
    
            condition_string = ""
        else:
            _condition = condition
            condition_string = strip_lambda(
                reflection.get_pretty_function_description(condition)
            )
    
        def test_function(data):
            with BuildContext(data):
                try:
                    value = data.draw(specifier)
                except UnsatisfiedAssumption:
                    data.mark_invalid()
                if not _condition(value):
                    data.mark_invalid()
                if predicate(value):
                    data.mark_interesting()
    
        successes = 0
        actual_runs = 0
        for actual_runs in range(1, RUNS + 1):
            # We choose the max_examples a bit larger than default so that we
            # run at least 100 examples outside of the small example generation
            # part of the generation phase.
            runner = ConjectureRunner(
                test_function,
                settings=Settings(
                    max_examples=150,
                    phases=no_shrink,
                    suppress_health_check=suppress_health_check,
                ),
            )
            runner.run()
            if runner.interesting_examples:
                successes += 1
                if successes >= required_runs:
                    return
    
            # If we reach a point where it's impossible to hit our target even
            # if every remaining attempt were to succeed, give up early and
            # report failure.
            if (required_runs - successes) > (RUNS - actual_runs):
                break
    
        event = reflection.get_pretty_function_description(predicate)
        if condition is not None:
            event += "|"
            event += condition_string
    
>       raise HypothesisFalsified(
            f"P({event}) ~ {successes} / {actual_runs} = "
            f"{successes / actual_runs:.2f} < {required_runs / RUNS:.2f}; "
            "rejected"
        )
E       tests.quality.test_discovery_ability.HypothesisFalsified: P(lambda x: 
"\n" in x) ~ 44 / 95 = 0.46 < 0.50; rejected
tests/quality/test_discovery_ability.py:118: HypothesisFalsified


-----BEGIN PGP SIGNATURE-----

iQGzBAEBCgAdFiEEJvtDgpxjkjCIVtam+C8H+466LVkFAmWVJEoACgkQ+C8H+466
LVlueQwAi40LADd5VRN6qzbWtut9IVZF49aAmFVyY9LliNq9GMVdski2bPuzxAj8
Meh7g9jFuAuObnPtapjw644t89maaXaPue4l17OYPiWeuhLzMJrvZd5rivQUgZXQ
hLFmLIAFVdbN0mCdO0cnIj1XxI+KFpny6cYVvahla+KG7PY3HTbUm36XrSuoG9LO
LHynLquooZVeZI/VU7Q6vNspWdOitcRTW133YwZy0bQrY41mr0CqC4st6DyNIVt+
x0qkevKUNZHGdUMrJ8J5J8noEo1fft95iguL6gD5+uIYejL5Zr6YpFBKrcg/3oX2
iACAAPwtLOXFjG+f3n5tUPDSENdQvf8asch7/c5s7DY/CGZlubX5JRg7t2axVDXh
oO72kjjkqXC1GGcmgf4W/B/L4ioOb+UcMdFXBaC5ruq24lBXOkfcvff8m7ZipoDU
CAWD1wo61iLfmvX8s8YxbM7xBEsVf9o5Q8XHOpLBVZJCPa90ikg9DjkIQQz4Bubx
bjldKKvB
=PuO1
-----END PGP SIGNATURE-----

Reply via email to