1
0
mirror of https://github.com/golang/go synced 2024-11-21 12:54:45 -07:00

misc/cgo/test: do not run wasteCPU during TestParallelSleep unless on arm

R=golang-dev, r, minux.ma, dave, bradfitz
CC=golang-dev
https://golang.org/cl/6532052
This commit is contained in:
Alex Brainman 2012-09-20 12:06:08 +10:00
parent 5a93fea08e
commit 81a9cc31c4

View File

@ -56,8 +56,12 @@ func wasteCPU() chan struct{} {
}
func testParallelSleep(t *testing.T) {
defer runtime.GOMAXPROCS(runtime.GOMAXPROCS(2))
defer close(wasteCPU())
if runtime.GOARCH == "arm" {
// on ARM, the 1.3s deadline is frequently missed,
// and burning cpu seems to help
defer runtime.GOMAXPROCS(runtime.GOMAXPROCS(2))
defer close(wasteCPU())
}
sleepSec := 1
start := time.Now()