From: Alex Brainman Date: Thu, 20 Sep 2012 02:06:08 +0000 (+1000) Subject: misc/cgo/test: do not run wasteCPU during TestParallelSleep unless on arm X-Git-Tag: go1.1rc2~2396 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=81a9cc31c46aada8ec4ff7e262b8b0a46e2ce57a;p=gostls13.git 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 --- diff --git a/misc/cgo/test/issue1560.go b/misc/cgo/test/issue1560.go index ac897aa33b..4f49399545 100644 --- a/misc/cgo/test/issue1560.go +++ b/misc/cgo/test/issue1560.go @@ -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()