proptest-rs / proptest

Hypothesis-like property testing for Rust
Apache License 2.0
1.63k stars 152 forks source link

feat: add option to interrupt test runner #460

Open grandizzy opened 3 weeks ago

grandizzy commented 3 weeks ago

At this moment there's no way to programmatically stop a test run in process with replay, which simply loops until a failure or all configured cases pass https://github.com/proptest-rs/proptest/blob/24412f5f10a365c8f12a71e3b3a053677ced91b0/proptest/src/test_runner/runner.rs#L609

It would be nice to be able to interrupt this loop at will so in a setup with multiple tests started at the same time (not using fork feature but rather parallelized using rayon for example) following scenarios could be achieved:

grandizzy commented 3 weeks ago

made a PR with proposed implementation https://github.com/proptest-rs/proptest/pull/461 @matthew-russo please have a look when time permits. thank you!

grandizzy commented 1 week ago

@matthew-russo any thoughts re this issue and associated PR really appreciated, thank you!