@@ -711,24 +711,6 @@ func (t *tester) registerTests() {
711
711
})
712
712
}
713
713
714
- // Runtime CPU tests.
715
- if ! t .compileOnly && t .hasParallelism () {
716
- for i := 1 ; i <= 4 ; i *= 2 {
717
- t .registerTest (fmt .Sprintf ("GOMAXPROCS=2 runtime -cpu=%d -quick" , i ),
718
- & goTest {
719
- variant : "cpu" + strconv .Itoa (i ),
720
- timeout : 300 * time .Second ,
721
- cpu : strconv .Itoa (i ),
722
- short : true ,
723
- testFlags : []string {"-quick" },
724
- // We set GOMAXPROCS=2 in addition to -cpu=1,2,4 in order to test runtime bootstrap code,
725
- // creation of first goroutines and first garbage collections in the parallel setting.
726
- env : []string {"GOMAXPROCS=2" },
727
- pkg : "runtime" ,
728
- })
729
- }
730
- }
731
-
732
714
// GOEXPERIMENT=rangefunc tests
733
715
if ! t .compileOnly {
734
716
t .registerTest ("GOEXPERIMENT=rangefunc go test iter" ,
@@ -864,10 +846,6 @@ func (t *tester) registerTests() {
864
846
})
865
847
}
866
848
867
- if t .raceDetectorSupported () {
868
- t .registerRaceTests ()
869
- }
870
-
871
849
const cgoHeading = "Testing cgo"
872
850
if t .cgoEnabled {
873
851
t .registerCgoTests (cgoHeading )
@@ -883,6 +861,40 @@ func (t *tester) registerTests() {
883
861
})
884
862
}
885
863
864
+ // Only run the API check on fast development platforms.
865
+ // Every platform checks the API on every GOOS/GOARCH/CGO_ENABLED combination anyway,
866
+ // so we really only need to run this check once anywhere to get adequate coverage.
867
+ // To help developers avoid trybot-only failures, we try to run on typical developer machines
868
+ // which is darwin,linux,windows/amd64 and darwin/arm64.
869
+ //
870
+ // The same logic applies to the release notes that correspond to each api/next file.
871
+ if goos == "darwin" || ((goos == "linux" || goos == "windows" ) && goarch == "amd64" ) {
872
+ t .registerTest ("API release note check" , & goTest {variant : "check" , pkg : "cmd/relnote" , testFlags : []string {"-check" }})
873
+ t .registerTest ("API check" , & goTest {variant : "check" , pkg : "cmd/api" , timeout : 5 * time .Minute , testFlags : []string {"-check" }})
874
+ }
875
+
876
+ // Runtime CPU tests.
877
+ if ! t .compileOnly && t .hasParallelism () {
878
+ for i := 1 ; i <= 4 ; i *= 2 {
879
+ t .registerTest (fmt .Sprintf ("GOMAXPROCS=2 runtime -cpu=%d -quick" , i ),
880
+ & goTest {
881
+ variant : "cpu" + strconv .Itoa (i ),
882
+ timeout : 300 * time .Second ,
883
+ cpu : strconv .Itoa (i ),
884
+ short : true ,
885
+ testFlags : []string {"-quick" },
886
+ // We set GOMAXPROCS=2 in addition to -cpu=1,2,4 in order to test runtime bootstrap code,
887
+ // creation of first goroutines and first garbage collections in the parallel setting.
888
+ env : []string {"GOMAXPROCS=2" },
889
+ pkg : "runtime" ,
890
+ })
891
+ }
892
+ }
893
+
894
+ if t .raceDetectorSupported () {
895
+ t .registerRaceTests ()
896
+ }
897
+
886
898
if goos != "android" && ! t .iOS () {
887
899
// Only start multiple test dir shards on builders,
888
900
// where they get distributed to multiple machines.
@@ -907,17 +919,6 @@ func (t *tester) registerTests() {
907
919
)
908
920
}
909
921
}
910
- // Only run the API check on fast development platforms.
911
- // Every platform checks the API on every GOOS/GOARCH/CGO_ENABLED combination anyway,
912
- // so we really only need to run this check once anywhere to get adequate coverage.
913
- // To help developers avoid trybot-only failures, we try to run on typical developer machines
914
- // which is darwin,linux,windows/amd64 and darwin/arm64.
915
- //
916
- // The same logic applies to the release notes that correspond to each api/next file.
917
- if goos == "darwin" || ((goos == "linux" || goos == "windows" ) && goarch == "amd64" ) {
918
- t .registerTest ("API check" , & goTest {variant : "check" , pkg : "cmd/api" , timeout : 5 * time .Minute , testFlags : []string {"-check" }})
919
- t .registerTest ("API release note check" , & goTest {variant : "check" , pkg : "cmd/relnote" , testFlags : []string {"-check" }})
920
- }
921
922
}
922
923
923
924
// addTest adds an arbitrary test callback to the test list.
@@ -1282,8 +1283,8 @@ func (t *tester) runPending(nextTest *distTest) {
1282
1283
worklist := t .worklist
1283
1284
t .worklist = nil
1284
1285
for _ , w := range worklist {
1285
- w .start = make (chan bool , runtime . NumCPU () * 2 )
1286
- w .end = make (chan struct {}, runtime . NumCPU () * 2 )
1286
+ w .start = make (chan bool )
1287
+ w .end = make (chan struct {})
1287
1288
// w.cmd must be set up to write to w.out. We can't check that, but we
1288
1289
// can check for easy mistakes.
1289
1290
if w .cmd .Stdout == nil || w .cmd .Stdout == os .Stdout || w .cmd .Stderr == nil || w .cmd .Stderr == os .Stderr {
@@ -1324,7 +1325,7 @@ func (t *tester) runPending(nextTest *distTest) {
1324
1325
// This makes testing a single package slower,
1325
1326
// but testing multiple packages together faster.
1326
1327
if strings .Contains (w .dt .heading , "GOMAXPROCS=2 runtime" ) {
1327
- maxbg = runtime .NumCPU () * 2
1328
+ maxbg = runtime .NumCPU ()
1328
1329
break
1329
1330
}
1330
1331
}
0 commit comments