-
Notifications
You must be signed in to change notification settings - Fork 30
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
Shrink with timeout instead of number #425
Comments
Perhaps @TysonMN is the one to comment on this 👀 |
The current default behavior is to shrink at most 100 times. That value can be set to a larger number, but shrinking cannot currently be restricted (only) by time. This seems like a reasonable request. However, I would prefer to see a motivating use case before implementing. |
I consider what I said to be a motivating use case:
I have experienced this from time to time. I don't have any code I am able to share, though. This has previously been reported in #223. |
I want an actual test someone wrote that doesn't fully shrink. I want to run the test myself. Issue #223 is blocked until you recall the test you had written. It is ok if the test is "sanitized" to remove or replace intellectual property from an employer. |
Actually, the default behavior is to stop shrinking if 100 values are discarded. |
I will try to keep it in mind and post such an example here the next time it happens. May be a while. |
I came across a blog post on property testing that used jqwik. It seems to have some nice functionality that would be great to have in Hedgehog.
One useful feature is shrinking for a certain amount of time (search this page for
ShrinkingMode.BOUNDED
): If a property fails, jqwik tries to shrink for (by defaut) up to 10 seconds. I'm not sure about the current Hedgehog functionality, but I am guessing it has a maximum number of shrinks instead of a time-based limit. The result is that, for complex inputs, the values may not be fully shrunk. When a property fails, I would find it much more useful to have the inputs be shrunk as much as possible, and I would have no problem waiting, say, up to 10 seconds for Hedgehog to produce the most shrunk values possible.The text was updated successfully, but these errors were encountered: