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
Massive performance drop in test_blacklisted_characters #1864
Comments
Sadly I haven't had a chance to track this down more precisely, or to figure out whether it's a real bug or a test bug. |
See issue #1864; but I'm simply disabling it for now due to eb huge slowdown.
I've determined that the slowdown is in the Looking through the The difference is that instead of finishing in an instant, this process becomes slower and slower (inconsistently) as the test continues to run. |
I traced the problem to hypothesis/hypothesis-python/src/hypothesis/internal/conjecture/datatree.py Lines 256 to 284 in 73e41c3
As the test continues to run, the The underlying cause is that this novelty-generator has no way to detect and avoid exhausted parts of the tree. So when novel prefixes are rare, it spins over and over until it gets lucky enough to stumble upon one. |
This effect isn't specific to def test_integers():
assert_no_examples(st.integers(0, 5), lambda x: False) Range sizes that are |
This isn't quite true. Note that it detects exhausted parts of the tree up until the point where the first possible branch occurs. This means that when there is a long forced prefix it finds that without spinning. I had (apparently mistakenly) assumed that that would be enough and that the cases where there were multiple possible branches to take there but we still got high rejection rates would be relatively uncommon. I think a fix that is probably sufficient for this case and is equivalent in result to the current is to always have the first non-forced block chosen uniformly at random from the set of available possibilities. Maybe something more sophisticated is needed in the general case. |
|
While testing some other changes, I stumbled across the fact that
test_blacklisted_characters
now takes a very long time to run.This can be seen in https://travis-ci.org/HypothesisWorks/hypothesis/jobs/504749908, and seems to be linked to #1846 in some way.
The text was updated successfully, but these errors were encountered: