You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes when a property fails and hedgehog shrinks, then hedgehog-fn errors out with the above message, so the failing test value can't be observed.
This seems to be called from apply, in
-- | Extract the root value from a 'TreeT'. Unsafe.
unsafeFromTree :: Functor m => TreeT (MaybeT m) a -> m a
unsafeFromTree =
fmap (maybe (error "empty generator in function") nodeValue) .
runMaybeT .
runTreeT
Is there any hint how to avoid generating functions that fail during shrinking? I would prefer no shrinking rather than an erroring out shrink.
Note that there's some workaround where I just try to re-run and hope that eventually a non-failing shrink path would be hit.
Also note that I tried to limit shrinks using withShrinks, but for some reason that seems to get caught in some endless loop (so it never generates an output). I only guess it is an endless loop, since I recall that when I try to print some generated functions, it would loop writing the function table endlessly. I only assume this is similar, hedgehog trying to print and format a not sufficiently shrunk function, and getting stuck in the loop. (Maybe this is worth a different issue?)
The text was updated successfully, but these errors were encountered:
Do you have a small property test that (probabilistically) replicates the issue? I haven't thought about this project for a long time, so I'd need to play around to debug things.
@LightAndLight yes, I managed to bare it down. Please give me some time to remove some more cruft so it can be ran independently, will share sometime around next week.
Sometimes when a property fails and hedgehog shrinks, then hedgehog-fn errors out with the above message, so the failing test value can't be observed.
This seems to be called from
apply
, inIs there any hint how to avoid generating functions that fail during shrinking? I would prefer no shrinking rather than an erroring out shrink.
Note that there's some workaround where I just try to re-run and hope that eventually a non-failing shrink path would be hit.
Also note that I tried to limit shrinks using withShrinks, but for some reason that seems to get caught in some endless loop (so it never generates an output). I only guess it is an endless loop, since I recall that when I try to print some generated functions, it would loop writing the function table endlessly. I only assume this is similar, hedgehog trying to print and format a not sufficiently shrunk function, and getting stuck in the loop. (Maybe this is worth a different issue?)
The text was updated successfully, but these errors were encountered: