-
Notifications
You must be signed in to change notification settings - Fork 42
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
** (FunctionClauseError) no function clause matching in :proper_arith.rand_choose/1 #221
Comments
That looks really bad. The error message usually appears when the generator tries to select something from an empty collection such as Did you try to use the sampling functions |
@alfert the failing generator ending up being something like the following:
and I've found it hard to test these generators in a console because they rely on building up state via Is there any way to provide more context in the stacktrace to narrow down where the error is coming from? |
@coop Indeed, difficult to give a good advice w/o knowing your system or your test setup in more detail. But if I meditate about this issue and #217 then I come these general ideas which might be totally obvious and/or helpful: Your state-dependent generators should we very aware of the state. Here something like
I find it sometimes helpful to have an abstract state enumeration (e.g. :init, :no_clients, :working, :overloaded) that direct Generally, I think it is more an art than a science to come up with a model that is easy to analyse and provokes enough interesting test situations to torture the system under test. |
Hi,
I'm seeing this error
** (FunctionClauseError) no function clause matching in :proper_arith.rand_choose/1
while running my test. I assume the problem is one of my generators are failing but there isn't enough information to determine which generator.I'm hoping that a better error message can be raised that can help target which generator is failing.
This is the stacktrace:
Elixir: 1.14.3
Erlang: 25.2.2
PropCheck 1.4.1
The text was updated successfully, but these errors were encountered: