Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ktong committed Feb 25, 2024
1 parent b40a984 commit e0cf392
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions rate/rate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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++ {
Expand All @@ -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")))
}

0 comments on commit e0cf392

Please sign in to comment.