foundry icon indicating copy to clipboard operation
foundry copied to clipboard

`max_test_reject_rate`: set a maximum test rejection rate per test function

Open 0xPhaze opened this issue 2 years ago • 3 comments

Component

Forge

Describe the feature you would like

I never found using max_test_rejects and vm.assume helpful, because changing the number of fuzz runs to a different value requires re-calibrating max_test_rejects to a sensible value. What's more is that this value will likely depend on the amount of tests you have that are making use of vm.assume.

It would be useful to be able to set a maximum reject rate that is applied per test function. Say, if I want the rejection rate to be a maximum of 10%, then this should only apply to the rejection count of each function and not globally discard the whole fuzz campaign.

Perhaps adding this information as natspec could be useful (#4085).

Edit: I see the max test rejects actually apply per function already, still it would be great to specify this in a percentage.

0xPhaze avatar Jan 14 '23 09:01 0xPhaze