diff --git a/rate/rate_test.go b/rate/rate_test.go index e87aa5a..be3d1c2 100644 --- a/rate/rate_test.go +++ b/rate/rate_test.go @@ -120,13 +120,14 @@ func TestHandler_race(t *testing.T) { return attr }, }), + rate.WithFirst(10), rate.WithEvery(0), ) logger := slog.New(handler) ctx := context.Background() start := make(chan struct{}) - procs := 1000 + procs := 20 var waitGroup sync.WaitGroup waitGroup.Add(procs) for i := 0; i < procs; i++ { @@ -142,5 +143,5 @@ func TestHandler_race(t *testing.T) { close(start) waitGroup.Wait() - assert.Equal(t, 200, bytes.Count(buf.Bytes(), []byte("\n"))) + assert.Equal(t, 20, bytes.Count(buf.Bytes(), []byte("\n"))) }