tag1consulting / goose

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

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

Closed mTsBucy1 closed 2 years ago

mTsBucy1 commented 2 years 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.