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
This is caused by the use of withGenQ which is defined in such a way that the "filtering" part of the quantification it defines accepts any generated value meaning the use of this function while shrinking a trace can lead to this situation where an action is selected even though the precondition fails.
The text was updated successfully, but these errors were encountered:
abailly-iohk
changed the title
Create issue / clarify on quickcheck-dynamic about preconditions while shrinking
ModelSpec is failing on a precondition because of incorrect generator
Jan 8, 2024
After a long discussion with @MaximilianAlgehed it seems that withGenQ is not the only issue here. There's also a problem with the generator which can produce TxOut below the minimal value accepted by ledger, which is fine in the model but fails in the execution. However this problem is masked by shrinking: Because there's no dependency between the various actions after we enter the Open state, the shrinker will try to remove any of them. If it removes the NewTx then the ObserveTx will fail because the transaction would not have been submitted and therefore cannot be observed, if it removes transactions before NewTx it can render it invalid because withGenQ does not filter anything.
There's therefore a couple of small fixes to be made to solve the issue, and also some modification to q-d to deprecate the use of withGenQ which does not really make sense.
When running
there test fails because of a
failed precondition
This is caused by the use of
withGenQ
which is defined in such a way that the "filtering" part of the quantification it defines accepts any generated value meaning the use of this function while shrinking a trace can lead to this situation where an action is selected even though the precondition fails.The text was updated successfully, but these errors were encountered: