advancedtelematic/quickcheck-state-machine

`forAllCommands` generating fewer commands than expected

Closed this issue · 3 comments

I'm using the library to run some tests that crucially depend on the amount of generated commands (for example, say, they will always fail if less than 10 commands have been executed, for internal reasons), and I've found that even if I give forAllCommands a large lower bound for the number of commands in a run, in some cases my tests fail because only one or two commands were generated.

I've written a minimum example to check how many commands the library is generating (see here) and it seems like the generated traces vary in size between 20 and 100 - even when giving QuickCheck a larger size parameter, this only seems to affect the maximum number of commands, but not the minimum, which is always lower than 100 - am I missing something? If not, is there any way to make sure every generated sequence of commands has a certain minimum length (other than discarding the shorter ones)?

I recently fixed a bug related to this problem, please try using master instead.

If that fixes the problem, I can try to make a new release soon.

If you need more fine grained control of how programs are generated, you can also have a look at the Markov module and the process registry example that uses it.

Switching to master fixed it, thanks!