Previously if you specify a min_message_latency greater than the default max_message_latency, the test would fail with a tokio error: overflow when subtracting durations. This updates the min_message_latency setter to update the max_message_latency if it is less than the new minimum value.
I also updated the max message latency setter to panic if provided with a value less than the minimum message latency. Given this is much more obviously incorrect to a user of the crate (given the default min latency of 0), I felt a panic was appropriate, and would provide an easier error to debug than the tokio message.
Previously if you specify a
min_message_latency
greater than the defaultmax_message_latency
, the test would fail with a tokio error:overflow when subtracting durations
. This updates themin_message_latency
setter to update themax_message_latency
if it is less than the new minimum value.I also updated the max message latency setter to panic if provided with a value less than the minimum message latency. Given this is much more obviously incorrect to a user of the crate (given the default min latency of 0), I felt a panic was appropriate, and would provide an easier error to debug than the tokio message.