rack / rack-attack

Rack middleware for blocking & throttling
MIT License
5.57k stars 337 forks source link

Freeze time to fix flakey specs #640

Closed jdelStrother closed 11 months ago

jdelStrother commented 11 months ago

Noticed a CI failure here - https://github.com/rack/rack-attack/actions/runs/6932050109/job/18855154765 - which I think is due to the system clock rolling over 15:14:00 while mid-test. How about freezing time in these specs?

santib commented 11 months ago

Good catch! I like ActiveSupport::Testing::TimeHelpers but in this gem we are already using Timecop. So I'd prefer to be consistent and stick with it.

jdelStrother commented 11 months ago

Oh I missed that. Will send an update

santib commented 11 months ago

Thank you @jdelStrother 🙌