foundry-rs/foundry

feature request: add support for fuzz/invariant timeouts

smartcontracts opened this issue · 3 comments

Component

Forge

Describe the feature you would like

Would be great to have support for configurable timeouts in fuzz/invariant testing. General goal here is to be able to run these types of tests for a specific amount of time rather than a specific number of runs.

Example interface that might work would be to have some option --fuzz-timeout-seconds and --invariant-timeout-seconds that causes individual tests to time out after some number of seconds. Timeouts would ideally apply to individual tests (i.e., test A runs for X seconds and times out but test B that started after test A will continue running).

It probably makes sense for timeouts to be considered failures by default. However, it would be ideal to have options like --allow-fuzz-timeout and --allow-invariant-timeout that causes Forge to not report timeouts as failures. This opens up a lot of possibilities with long-running fuzzing jobs.

Additional context

We've been messing with custom tooling to achieve this but doing it in forge is just way simpler.

thanks @smartcontracts would you be ok to adding your input to #990 and tracking impl there?

Yeah sure thing, will do

Thank you, closing this one as dupe then, will add thoughts on pr