mirror of
https://github.com/gomods/athens
synced 2026-02-03 13:20:30 +00:00
pkg/download/addon: fix test error msg in TestPoolLogic. (#1034)
This commit is contained in:
committed by
Marwan Sulaiman
parent
f0e931311b
commit
fd10bed609
@@ -20,15 +20,16 @@ import (
|
||||
// at one time.
|
||||
func TestPoolLogic(t *testing.T) {
|
||||
m := &mockPool{}
|
||||
dp := WithPool(5)(m)
|
||||
workers := 5
|
||||
dp := WithPool(workers)(m)
|
||||
ctx := context.Background()
|
||||
m.ch = make(chan struct{})
|
||||
for i := 0; i < 10; i++ {
|
||||
go dp.List(ctx, "")
|
||||
}
|
||||
<-m.ch
|
||||
if m.num != 5 {
|
||||
t.Fatalf("expected 4 workers but got %v", m.num)
|
||||
if m.num != workers {
|
||||
t.Fatalf("expected %d workers but got %v", workers, m.num)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user