From 130458470a11d1f16908d7db7fe683b621541a36 Mon Sep 17 00:00:00 2001 From: Dmitriy Vyukov Date: Thu, 6 Mar 2014 13:16:14 +0400 Subject: [PATCH] run.bash: explain why we set GOMAXPROCS for runtime test Fixes #7459. LGTM=rsc R=rsc CC=golang-codereviews https://golang.org/cl/71060044 --- src/run.bash | 2 ++ src/run.bat | 10 +++++++++- src/run.rc | 2 ++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/run.bash b/src/run.bash index a3eecff0f0..8e8715cab0 100755 --- a/src/run.bash +++ b/src/run.bash @@ -54,6 +54,8 @@ echo '# Testing packages.' time go test std -short -timeout=$(expr 120 \* $timeout_scale)s echo +# We set GOMAXPROCS=2 in addition to -cpu=1,2,4 in order to test runtime bootstrap code, +# creation of first goroutines and first garbage collections in the parallel setting. echo '# GOMAXPROCS=2 runtime -cpu=1,2,4' GOMAXPROCS=2 go test runtime -short -timeout=$(expr 300 \* $timeout_scale)s -cpu=1,2,4 echo diff --git a/src/run.bat b/src/run.bat index f01032699e..fdaacfff44 100644 --- a/src/run.bat +++ b/src/run.bat @@ -42,11 +42,19 @@ go test std -short -timeout=120s if errorlevel 1 goto fail echo. -echo # runtime -cpu=1,2,4 +set OLDGOMAXPROCS=%GOMAXPROCS% + +:: We set GOMAXPROCS=2 in addition to -cpu=1,2,4 in order to test runtime bootstrap code, +:: creation of first goroutines and first garbage collections in the parallel setting. +echo # GOMAXPROCS=2 runtime -cpu=1,2,4 +set GOMAXPROCS=2 go test runtime -short -timeout=300s -cpu=1,2,4 if errorlevel 1 goto fail echo. +set GOMAXPROCS=%OLDGOMAXPROCS% +set OLDGOMAXPROCS= + echo # sync -cpu=10 go test sync -short -timeout=120s -cpu=10 if errorlevel 1 goto fail diff --git a/src/run.rc b/src/run.rc index f9837d4fce..2613621556 100755 --- a/src/run.rc +++ b/src/run.rc @@ -32,6 +32,8 @@ echo '# Testing packages.' time go test std -short -timeout 120s echo +# We set GOMAXPROCS=2 in addition to -cpu=1,2,4 in order to test runtime bootstrap code, +# creation of first goroutines and first garbage collections in the parallel setting. echo '# GOMAXPROCS=2 runtime -cpu=1,2,4' GOMAXPROCS=2 go test runtime -short -timeout 240s -cpu 1,2,4 echo -- 2.48.1