Skip to content

Commit d9648ba

Browse files
avoid spinning up unnecessary deployers
1 parent 59d381b commit d9648ba

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tools/testing/cmd/loadtest/main.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"errors"
66
"fmt"
77
"log"
8+
"math"
89
"os"
910
"os/signal"
1011
"path/filepath"
@@ -131,9 +132,11 @@ func RunSamples(ctx context.Context, samplePatterns, excludePatters []string, co
131132
close(samplesChannel)
132133
}()
133134

135+
workers := int(math.Min(float64(concurrency), float64(len(samples))))
136+
134137
var wg sync.WaitGroup
135-
log.Printf("Starting %v concurrent tests...", concurrency)
136-
for i := 0; i < concurrency; i++ {
138+
log.Printf("Starting %v concurrent tests...", workers)
139+
for i := 0; i < workers; i++ {
137140
wg.Add(1)
138141
go func(id int) {
139142
defer wg.Done()

0 commit comments

Comments
 (0)