tokio-rs / turmoil

Add hardship to your tests
MIT License
792 stars 50 forks source link

Validate `tick_duration` millisecond resolution #178

Open sgbalogh opened 4 months ago

sgbalogh commented 4 months ago

Hi! I noticed some strange behavior while running a simulation where the tick duration was sub-millisecond, and discovered that tokio::time::sleep apparently uses millisecond resolution.

I added some validation to the builder, to panic whenever a duration with higher than ms resolution is supplied, since it looked like some other validation was already happening here. Let me know if this seems useful.

Love the project btw!