-
-
Notifications
You must be signed in to change notification settings - Fork 174
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
Allow specifying max number of shrinks per test #4162
Comments
Any example of such option in the other libraries? How it can be configured compared to another test...? On it's own reducing shrinker can be done at various level: the arbitrary itself (what we do with Having more context would help as it seems that you know how they do it might reduce the exploratory time required just to put a status (do/don't do) on such ticket. Side-note: You may use Like: fc.uuid().noShrink() or: fc.assert(myProperty, { numRuns: 5, endOnFailure: true }) |
@dubzzz sure,
Alternatives are not really the same because I do not really want to give up on shrinking... |
As we already have The remaining part to decide is: what to stop shrinking as shrinker lives in a 2D-plan so 2 directions can be stopped separately or together. |
Maybe the existing With such option, Another option would be to make a dedicated arbitrary to handle that. |
I re-checked this issue as I'm planning to solve it in the next major (on it). The solution I currently came up with is to handle it at Arbitrary level as I already do for the noShrink case. The idea is the following:
It has the huge benefits not to slow down nominal users, to be implementable on user land too... But I'll need to assess the case in which the shrink gets called without any context. It can be the case when nesting arbitraries to re-use their shrink capabilities. The real huge benefit of the approach is that it fully fulfills my plugin-based target. As for now context is untyped it does bring any concerns related to mapping on an existing context to extend it with extra pieces of data. |
Very interesting 👍 Essentially, |
|
🚀 Feature Request
Allow specifying max number of shrinks.
The idea is not new, other property testing framework (
QuickCheck
,HedgeHog
,FSCheck
in Haskell and FSharp have it)Motivation
Performance and friendliness with integration tests.
Also related to #4161.
Example
The text was updated successfully, but these errors were encountered: