tag1consulting / goose

Load testing framework, inspired by Locust
https://tag1.com/goose
Apache License 2.0
759 stars 69 forks source link

Fix panic when a empty wait time interval is set #514

Closed mTsBucy1 closed 1 year ago

mTsBucy1 commented 1 year ago

Previously, despite what the documentation says ("inclusively between the low and high"), the wait time was generated with the upper bound exclusive. This lead to the problem that a constant wait time (the same upper and lower limit) would panic because there is no valid value for rand to return. thread 'tokio-runtime-worker' panicked at 'cannot sample empty range', [left out for privacy]\rand-0.8.5\src\rng.rs:134:9

This PR fixes this by this by using a closed range to generate the wait time. Additionally, a example in the documentation now reflects this usecase.