diff --git a/connect_ext_test.go b/connect_ext_test.go index af541259..e6b5a6eb 100644 --- a/connect_ext_test.go +++ b/connect_ext_test.go @@ -26,6 +26,7 @@ import ( "math" "math/rand" "net/http" + "runtime" "strings" "sync" "testing" @@ -475,7 +476,7 @@ func TestConcurrentStreams(t *testing.T) { server := memhttptest.NewServer(t, mux) var done, start sync.WaitGroup start.Add(1) - for i := 0; i < 100; i++ { + for i := 0; i < runtime.GOMAXPROCS(0)*8; i++ { done.Add(1) go func() { defer done.Done() diff --git a/internal/memhttp/memhttp_test.go b/internal/memhttp/memhttp_test.go index 06e11ee4..9218f7ed 100644 --- a/internal/memhttp/memhttp_test.go +++ b/internal/memhttp/memhttp_test.go @@ -19,6 +19,7 @@ import ( "fmt" "io" "net/http" + "runtime" "sync" "testing" "time" @@ -30,7 +31,7 @@ import ( func TestServerTransport(t *testing.T) { t.Parallel() - const concurrency = 100 + concurrency := runtime.GOMAXPROCS(0) * 8 const greeting = "Hello, world!" handler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {