Skip to content
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

When bumping ClojureScript predicates can't be satisfied #21

Closed
felipethome opened this issue Apr 8, 2020 · 6 comments
Closed

When bumping ClojureScript predicates can't be satisfied #21

felipethome opened this issue Apr 8, 2020 · 6 comments

Comments

@felipethome
Copy link

When bumping clojurescript to version 1.10.597 I start to get the error

Error: Couldn't satisfy such-that predicate after 10 tries

when trying to generate data based on Schema.

@gfredericks
Copy link
Contributor

Could you share a schema that does this?

@felipethome
Copy link
Author

I'm sorry. This is probably my mistake because I can't reproduce the issue in a simple project. You can close this.

In my project, full of dependencies I get the error even when trying to generate the simplest schema like {:a s/Int} with schema-generators.generators/generate

Do you have a guess of what it can be?

Error: Couldn't satisfy such-that predicate after 10 tries.
    at new cljs$core$ExceptionInfo (/js/app/cljs-runtime/cljs.core.js:36925:10)
    at Function.eval [as cljs$core$IFn$_invoke$arity$3] (/js/app/cljs-runtime/cljs.core.js:36986:9)
    at Function.eval [as cljs$core$IFn$_invoke$arity$2] (/js/app/cljs-runtime/cljs.core.js:36982:26)
    at eval (/js/app/cljs-runtime/clojure.test.check.generators.js:752:26)
    at eval (/js/app/cljs-runtime/clojure.test.check.generators.js:723:102)
    at Object.clojure$test$check$generators$such_that_helper [as such_that_helper] (/js/app/cljs-runtime/clojure.test.check.generators.js:724:3)
    at eval (/js/app/cljs-runtime/clojure.test.check.generators.js:808:38)
    at eval (/js/app/cljs-runtime/clojure.test.check.generators.js:240:98)
    at Object.clojure$test$check$generators$call_gen [as call_gen] (/js/app/cljs-runtime/clojure.test.check.generators.js:222:122)
    at Function.eval [as cljs$core$IFn$_invoke$arity$2] (/js/app/cljs-runtime/clojure.test.check.generators.js:470:72)

@gfredericks
Copy link
Contributor

It doesn't look familiar.

If you think the cause is something to do with your dependencies list, and you're interested in continuing to pursue this, you could work on wittling down the dependencies list to see what is the smallest set that still reproduces the bug.

@felipethome
Copy link
Author

The weirdest part is that only happens when I bump clojurescript from "1.10.520" to "1.10.597".

I will do that, thanks!

@felipethome
Copy link
Author

I was able to reproduce the issue I'm having:
https://github.com/felipethome/sg-issue

The problem is not with schema-generators. It arises when I use shadow-cljs version >= 2.8.84, or when I use a version < 2.8.83 but bump clojurescript from version 1.10.520 to version 1.10.597.

The dependecy trees using lein deps :tree look identical though.

I'm closing this issue, but if you a guess about what may happening would help a lot.

@gfredericks
Copy link
Contributor

you could try using the random number generator in clojure.test.check.random to confirm you get the same numbers in all of these scenarios

I'm not sure that explanation helps though, because if your example (just an int?) doesn't involve such-that at all, then I have no idea why you'd get a such-that error in the first place.

but maybe still worth a try.

The theory is that if some kind of compilation bug is resulting in a degenerate RNG that always generates the same number, such-that will start failing frequently

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants