You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test_binascii: test_b2a_roundtrip() failure with Hypothesis #109421
It seems like Hypothesis found an issue. Can someone have a look? How can it be reproduced locally?
ERROR: test_b2a_roundtrip (test.test_binascii.MemoryviewBinASCIITest.test_b2a_roundtrip)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/runner/work/cpython/cpython-ro-srcdir/Lib/test/test_binascii.py", line 233, in test_b2a_roundtrip
binary=hypothesis.strategies.binary(),
^^^^^^^
File "/home/runner/work/cpython/cpython-builddir/hypovenv/lib/python3.13/site-packages/hypothesis/core.py", line 1386, in wrapped_testraise the_error_hypothesis_found
File "/home/runner/work/cpython/cpython-ro-srcdir/Lib/test/test_binascii.py", line 237, in test_b2a_roundtrip
converted = binascii.b2a_uu(self.type2test(binary), backtick=backtick)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^binascii.Error: At most 45 bytes at once
Falsifying example: test_b2a_roundtrip(
self=<test.test_binascii.MemoryviewBinASCIITest testMethod=test_b2a_roundtrip>,
binary=b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
backtick=False,
)
You can reproduce this example by temporarily adding @reproduce_failure('6.84.0', b'AXicY2RgYBwciIEBAA2TAC8=') as a decorator on your test case
----------------------------------------------------------------------
Ran 85 tests in 127.421s
FAILED (errors=1, skipped=1)
test test_binascii failed
vstinner@mona$ env/bin/python -m test test_binascii -v
(...)
======================================================================
ERROR: test_b2a_qp_a2b_qp_round_trip (test.test_binascii.BinASCIITest.test_b2a_qp_a2b_qp_round_trip)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/vstinner/python/main/Lib/test/test_binascii.py", line 400, in test_b2a_qp_a2b_qp_round_trip
binary=hypothesis.strategies.binary(),
^^^^^^^
File "/home/vstinner/python/main/env/lib/python3.13/site-packages/hypothesis/core.py", line 1263, in wrapped_test
fail_health_check(settings, msg, HealthCheck.differing_executors)
File "/home/vstinner/python/main/env/lib/python3.13/site-packages/hypothesis/internal/healthcheck.py", line 27, in fail_health_checkraise FailedHealthCheck(message)
hypothesis.errors.FailedHealthCheck: The method BinASCIITest.test_b2a_qp_a2b_qp_round_trip was called from multiple different executors. This may lead to flaky tests and nonreproducible errors when replaying from database.
See https://hypothesis.readthedocs.io/en/latest/healthchecks.html for more information about this. If you want to disable just this health check, add HealthCheck.differing_executors to the suppress_health_check settings for this test.
(...)
And then many tests fail with the same error message:
It produces a correct result on main (after my fix):
======================================================================
ERROR: test_b2a_roundtrip (test.test_binascii.MemoryviewBinASCIITest.test_b2a_roundtrip)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/sobolev/Desktop/cpython/Lib/test/test_binascii.py", line 233, in test_b2a_roundtrip
binary=hypothesis.strategies.binary(max_size=45),
^^^^^^^
File "/Users/sobolev/Desktop/cpython/.venv/lib/python3.13/site-packages/hypothesis/core.py", line 1290, in wrapped_test
raise DidNotReproduce(
hypothesis.errors.DidNotReproduce: Expected the test to raise an error, but it completed successfully.
----------------------------------------------------------------------
hypothesis.errors.FailedHealthCheck: The method BinASCIITest.test_b2a_qp_a2b_qp_round_trip was called from multiple different executors. This may lead to flaky tests and nonreproducible errors when replaying from database.
See https://hypothesis.readthedocs.io/en/latest/healthchecks.html for more information about this. If you want to disable just this health check, add HealthCheck.differing_executors to the suppress_health_check settings for this test.
I don't understand this message. Why does it want to contact a remote server since I want to reproduce the issue locally? Maybe the hint in the first message is wrong?
You can reproduce this example by temporarily adding @reproduce_failure('6.84.0', b'AXicY2RgYBwciIEBAA2TAC8=') as a decorator on your test case
I don't understand this message. Why does it want to contact a remote server since I want to reproduce the issue locally? Maybe the hint in the first message is wrong?
This is interesting, it should not happen, because I disabled this check ~a week ago:
Activity
vstinner commentedon Sep 14, 2023
I modified the test as requested to try to reproduce the issue:
I install hypothesis in a venv:
When I try to reproduce the failure, I get:
And then many tests fail with the same error message:
I gave up at the FailedHealthCheck.
vstinner commentedon Sep 14, 2023
cc @pganssle @Zac-HD
hugovk commentedon Sep 14, 2023
The good news is this is a duplicate of #109418 that was fixed moments ago by #109419.
Perhaps @sobolevn can assist with reproducing, if you're still interested?
sobolevn commentedon Sep 14, 2023
@vstinner try this:
It produces a correct result on
main(after my fix):sobolevn commentedon Sep 14, 2023
Btw, if you have any questions about hypothesis, feel free to ping me :)
vstinner commentedon Sep 14, 2023
I don't understand this message. Why does it want to contact a remote server since I want to reproduce the issue locally? Maybe the hint in the first message is wrong?
vstinner commentedon Sep 14, 2023
Oh, two hours ago, nice.
sobolevn commentedon Sep 14, 2023
This is interesting, it should not happen, because I disabled this check ~a week ago:
cpython/Lib/test/support/hypothesis_helper.py
Lines 13 to 16 in 68a6f21
I will try to reproduce your case.