From 9d0c5d8ffa917798ebfce9aa68ca7c5ce27b1797 Mon Sep 17 00:00:00 2001 From: MoofMonkey <11695747+MoofMonkey@users.noreply.github.com> Date: Tue, 4 Oct 2022 05:50:06 +0300 Subject: [PATCH] Limit TestLongSiteWithDictionaries concurrency --- h2mux/h2mux_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/h2mux/h2mux_test.go b/h2mux/h2mux_test.go index a28abb59..9886bedd 100644 --- a/h2mux/h2mux_test.go +++ b/h2mux/h2mux_test.go @@ -9,6 +9,7 @@ import ( "math/rand" "net" "os" + "runtime" "strconv" "strings" "sync" @@ -976,9 +977,10 @@ func TestLongSiteWithDictionaries(t *testing.T) { tstLen := 500 errGroup, _ := errgroup.WithContext(context.Background()) + errGroup.SetLimit(runtime.NumGoroutine()) for i := 0; i < tstLen; i++ { errGroup.Go(func() error { - path := paths[rand.Int()%len(paths)] + path := paths[rand.Intn(len(paths))] return sampleSiteTest(muxPair, path, files) }) }