-
Notifications
You must be signed in to change notification settings - Fork 586
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
Inexplicable test failures on 3.13.0+ #751
Comments
|
We certainly consider it a bug when public APIs stop working, but I don't think we can help much without knowing more about the strategy in question or a reproducible example - minimal is preferred but not absolutely required. I suspect that @DRMacIver might also be able to help out 'for a modest fee' if that would help with the legal side of things. |
|
Success! Once I realised that most of the code involved in my test was actually irrelevant, I was able to cut it down to something pretty small. Here's a self-contained example: from hypothesis import strategies as s, given
def strat():
return s.builds(dict, one=strat_one())
@s.composite
def strat_one(draw):
return draw(s.builds(dict, val=s.builds(dict, two=strat_two())))
@s.composite
def strat_two(draw):
return draw(s.builds(dict, some_text=s.text(min_size=1)))
@given(strat())
def test(v):
pass
test()This passes instantly on Hypothesis 3.12.0, and hits the timeout on 3.13.0 and 3.14.0 with zero examples found. |
|
This is with Python 3.6.2 from OSX Brew, and Hypothesis 3.14.1 Small lists get generated fine, just as before: Bigger lists (the breaking point is about 250-270) generate a list of empty strings: Also, the result between 300..900 elements keeps generating 900 element list, on multiple invocations of .example() which is odd. When producing same size bigger lists but with unique=True, it tries for a while, hits a timeout, and produces this: |
|
@marcinpohl To some extent, being bad at large examples is a deliberate design choice. Hypothesis operates on a fixed size buffer for its example representation, and generally isn't going to work very well for any strategy that doesn't have any small examples - such things are both harder to find good examples in and less likely to work because of the comparatively slow tests. That being said, we can definitely do better in this case. Pull request incoming. |
I have a test that looks something like this:
On Hypothesis 3.12.0 this works fine. On Hypothesis 3.13.0, every example is rejected, eventually hitting the timeout (if I turn up the verbosity, I see "Run complete after 288 examples (0 valid) and 0 shrinks").
However, if I change it to this, which seems like it should be identical, then the test works fine on both versions of Hypothesis:
Unfortunately this codebase is proprietary, and
fs.finappsis a pretty complex strategy, so I'm not sure exactly where to start tracking this down, and I haven't had any luck constructing a minimal reproducer yet.The text was updated successfully, but these errors were encountered: