uber-go / ratelimit

A Go blocking leaky-bucket rate limit implementation
MIT License
4.32k stars 300 forks source link

Run tests in parallel. #98

Closed rabbbit closed 2 years ago

rabbbit commented 2 years ago

In #93 @storozhukBM adds test parallization, which is unrelated to the actual change. I'd rather have this as a separate PR.

The test currently take ~12 seconds on my laptop, so I see why we might want to run them in parallel. There are other parallelization opportunities (we could paralelize each of the subtests for each of the rate-limiters), but this is a good start.

Before:

> go test ./... -race -count 1
ok      go.uber.org/ratelimit   12.739s

After:

> go test ./... -race -count 1
ok      go.uber.org/ratelimit   6.178s
codecov[bot] commented 2 years ago

Codecov Report

Merging #98 (16b573b) into main (29ac3a2) will not change coverage. The diff coverage is n/a.

@@            Coverage Diff            @@
##              main       #98   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            4         4           
  Lines           97        97           
=========================================
  Hits            97        97           

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 29ac3a2...16b573b. Read the comment docs.

rabbbit commented 2 years ago

Given this is straighforward, should have no impact and only affects development, merging this in.