Skip to content

Commit a9e50a6

Browse files
committed
cmd/dist: consolidate runtime CPU tests
Instead of running: go test -short runtime -cpu=1 go test -short runtime -cpu=2 go test -short runtime -cpu=4 Run just: go test -short runtime -cpu=1,2,4 This is a return to the Go 1.4.2 behavior. We lose incremental display of progress and per-cpu timing information, but we don't have to recompile and relink the runtime test, which is slow. This cuts about 10s off all.bash. Updates #10571. Change-Id: I6e8c7149780d47439f8bcfa888e6efc84290c60a Reviewed-on: https://go-review.googlesource.com/9350 Reviewed-by: Dave Cheney <dave@cheney.net> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
1 parent 2692f48 commit a9e50a6

File tree

1 file changed

+12
-15
lines changed

1 file changed

+12
-15
lines changed

src/cmd/dist/test.go

+12-15
Original file line numberDiff line numberDiff line change
@@ -199,21 +199,18 @@ func (t *tester) registerTests() {
199199
}
200200

201201
// Runtime CPU tests.
202-
for _, cpu := range []string{"1", "2", "4"} {
203-
cpu := cpu
204-
testName := "runtime:cpu" + cpu
205-
t.tests = append(t.tests, distTest{
206-
name: testName,
207-
heading: "GOMAXPROCS=2 runtime -cpu=1,2,4",
208-
fn: func() error {
209-
cmd := t.dirCmd("src", "go", "test", "-short", t.timeout(300), "runtime", "-cpu="+cpu)
210-
// We set GOMAXPROCS=2 in addition to -cpu=1,2,4 in order to test runtime bootstrap code,
211-
// creation of first goroutines and first garbage collections in the parallel setting.
212-
cmd.Env = mergeEnvLists([]string{"GOMAXPROCS=2"}, os.Environ())
213-
return cmd.Run()
214-
},
215-
})
216-
}
202+
testName := "runtime:cpu124"
203+
t.tests = append(t.tests, distTest{
204+
name: testName,
205+
heading: "GOMAXPROCS=2 runtime -cpu=1,2,4",
206+
fn: func() error {
207+
cmd := t.dirCmd("src", "go", "test", "-short", t.timeout(300), "runtime", "-cpu=1,2,4")
208+
// We set GOMAXPROCS=2 in addition to -cpu=1,2,4 in order to test runtime bootstrap code,
209+
// creation of first goroutines and first garbage collections in the parallel setting.
210+
cmd.Env = mergeEnvLists([]string{"GOMAXPROCS=2"}, os.Environ())
211+
return cmd.Run()
212+
},
213+
})
217214

218215
// sync tests
219216
t.tests = append(t.tests, distTest{

0 commit comments

Comments
 (0)