Limit TestLongSiteWithDictionaries concurrency

This commit is contained in:
MoofMonkey 2022-10-04 05:50:06 +03:00
parent c053c1e8c4
commit 9d0c5d8ffa
1 changed files with 3 additions and 1 deletions

View File

@ -9,6 +9,7 @@ import (
"math/rand" "math/rand"
"net" "net"
"os" "os"
"runtime"
"strconv" "strconv"
"strings" "strings"
"sync" "sync"
@ -976,9 +977,10 @@ func TestLongSiteWithDictionaries(t *testing.T) {
tstLen := 500 tstLen := 500
errGroup, _ := errgroup.WithContext(context.Background()) errGroup, _ := errgroup.WithContext(context.Background())
errGroup.SetLimit(runtime.NumGoroutine())
for i := 0; i < tstLen; i++ { for i := 0; i < tstLen; i++ {
errGroup.Go(func() error { errGroup.Go(func() error {
path := paths[rand.Int()%len(paths)] path := paths[rand.Intn(len(paths))]
return sampleSiteTest(muxPair, path, files) return sampleSiteTest(muxPair, path, files)
}) })
} }