go-chi / chi

lightweight, idiomatic and composable router for building Go HTTP services
https://go-chi.io
MIT License
18.54k stars 988 forks source link

Refactor throttle middleware tests as prone to intermittent failure #608

Open pkieltyka opened 3 years ago

pkieltyka commented 3 years ago

https://github.com/go-chi/chi/blob/master/middleware/throttle_test.go

It's often that when I submit a PR, and the code runs through github ci, it will fail -- https://github.com/go-chi/chi/actions

I have to re-run the jobs to have it pass, it seems to be a timing issue. When running locally, it seems to work well pretty consistently, but I've seen the rare failing case.

VojtechVitek commented 3 years ago

I didn't write those tests, but I can take a look if we have an example of the CI error.

pkieltyka commented 3 years ago

I've just disabled the flaky test, and will rename this ticket..

https://github.com/go-chi/chi/commit/25eb15cdd4f644896eac2ac05d4e3e932f34a188