runner: Take the number of workers as a flag.
Default to the number of CPUs. Avoids the tests launching 64 valgrinds in parallel on machines without gobs of memory. Change-Id: I9eeb365b48aa7407e303d161f90ce69a591a884c Reviewed-on: https://boringssl-review.googlesource.com/1375 Reviewed-by: Adam Langley <agl@google.com>
This commit is contained in:
committed by
Adam Langley
parent
bef270a9cf
commit
2bc8e6fc9a
@@ -9,6 +9,7 @@ import (
|
||||
"net"
|
||||
"os"
|
||||
"os/exec"
|
||||
"runtime"
|
||||
"strings"
|
||||
"sync"
|
||||
"syscall"
|
||||
@@ -856,6 +857,7 @@ func statusPrinter(doneChan chan struct{}, statusChan chan statusMsg, total int)
|
||||
|
||||
func main() {
|
||||
var flagTest *string = flag.String("test", "", "The name of a test to run, or empty to run all tests")
|
||||
var flagNumWorkers *int = flag.Int("num-workers", runtime.NumCPU(), "The number of workers to run in parallel.")
|
||||
|
||||
flag.Parse()
|
||||
|
||||
@@ -866,7 +868,7 @@ func main() {
|
||||
|
||||
var wg sync.WaitGroup
|
||||
|
||||
const numWorkers = 64
|
||||
numWorkers := *flagNumWorkers
|
||||
|
||||
statusChan := make(chan statusMsg, numWorkers)
|
||||
testChan := make(chan *testCase, numWorkers)
|
||||
|
||||
Reference in New Issue
Block a user