Welcome! Please see the About page for a little more info on how this works.

0 votes
in Spec by

It's pretty easy to write a spec whose generator fails like this:

`Couldn't satisfy such-that predicate after 100 tries.`

This is of course expected in many ways, but it's a very unhelpful error. Some things that could make this better include:
- Including the spec that failed in the exception. I only see one invocation of gen/such-that in spec.clj, and it appears to have the spec's form at hand. gen/such-that takes an exception constructor where this could be used.
- Allow max-tries to be changed from the hardcoded value of 100. When dealing with an intermittent failure, it can be useful to crank down max-tries to a very small number, making the failure easier to reproduce.

2 Answers

0 votes
by

Comment made by: alexmiller

These are reasonable suggestions and this area is likely to evolve in tandem with test.check to provide better info.

0 votes
by
Reference: https://clojure.atlassian.net/browse/CLJ-2097 (reported by alex+import)
...