-
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
Stuck in a loop forever when shrinking with targeted property-based testing #2395
Comments
|
Thanks for the bug report! I've got a hunch as to what might be going on here - we've got a bit at the end which uses shrinking to try to find minimized versions of each target score, and I suspect it's getting over eager in terms of how much work it's doing. I'll take a look into this today. |
|
My guess is that if a failure is found during (I had recently noticed this as a theoretical problem, but wasn't sure if it could happen in practice.) |
This was also one of my guesses when looking into it, but it turns out that it's actually a genuine infinite loop. It's confusingly hard to trigger through "nice" tests, but it's obviously a potential problem once I looked in the right place. PR incoming shortly. |
|
Ah, attempting to explain in the PR why we're not hitting this bug all the time let me figure out what's actually going on. It's a problem with the fact that the pareto front is approximate. If we shrink something in the pareto front to something that |
Hi, thanks for the awesome library! I'm trying to wrap by head around
hypothesis.targetso I tried playing with an artificial example. The test generates floats smaller than a threshold value and it's expected to fail when the float is close enough to the magic value 42.5. Targeting works fine here as in many cases it can find the problematic value when non-targeted generation cannot.However, sometimes it gets stuck in a loop forever. Here's an example that gets stuck in my case:
The verbose printing keeps printing lines such as:
I'm using Hypothesis 5.8.3 and running the test in pytest. I know the test is contrived, but I'm mostly wondering why it gets stuck.
EDIT: I'm exaggerating that it would be stuck forever, I stopped waiting after a minute or so :)
The text was updated successfully, but these errors were encountered: