From e0cf39224036d2eb885b6ec2734c9af98b721797 Mon Sep 17 00:00:00 2001 From: ktong Date: Sat, 24 Feb 2024 21:18:34 -0800 Subject: [PATCH] fix tests --- rate/rate_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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"))) }