-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
test_binascii: test_b2a_roundtrip() failure with Hypothesis #109421
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I modified the test as requested to try to reproduce the issue: diff --git a/Lib/test/test_binascii.py b/Lib/test/test_binascii.py
index 3d3e0746e9..cec72c5c78 100644
--- a/Lib/test/test_binascii.py
+++ b/Lib/test/test_binascii.py
@@ -5,7 +5,7 @@
import array
import re
from test.support import bigmemtest, _1G, _4G
-from test.support.hypothesis_helper import hypothesis
+import hypothesis
# Note: "*_hex" functions are aliases for "(un)hexlify"
@@ -16,6 +16,7 @@
all_functions = a2b_functions + b2a_functions + ['crc32', 'crc_hqx']
+@hypothesis.reproduce_failure('6.84.0', b'AXicY2RgYBwciIEBAA2TAC8=')
class BinASCIITest(unittest.TestCase):
type2test = bytes I install hypothesis in a venv: ./python -m venv env
env/bin/python -m pip install hypothesis When I try to reproduce the failure, I get: 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_check
raise 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:
I gave up at the FailedHealthCheck. |
@vstinner try this:
It produces a correct result on
|
Btw, if you have any questions about hypothesis, feel free to ping me :) |
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: cpython/Lib/test/support/hypothesis_helper.py Lines 13 to 16 in 68a6f21
I will try to reproduce your case. |
It seems like Hypothesis found an issue. Can someone have a look? How can it be reproduced locally?
build: https://github.com/python/cpython/actions/runs/6189519251/job/16803785370
The text was updated successfully, but these errors were encountered: