Limit TestLongSiteWithDictionaries concurrency
This commit is contained in:
parent
c053c1e8c4
commit
9d0c5d8ffa
|
@ -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)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue