]> Cypherpunks repositories - gostls13.git/commitdiff
misc/cgo/test: do not run wasteCPU during TestParallelSleep unless on arm
authorAlex Brainman <alex.brainman@gmail.com>
Thu, 20 Sep 2012 02:06:08 +0000 (12:06 +1000)
committerAlex Brainman <alex.brainman@gmail.com>
Thu, 20 Sep 2012 02:06:08 +0000 (12:06 +1000)
R=golang-dev, r, minux.ma, dave, bradfitz
CC=golang-dev
https://golang.org/cl/6532052

misc/cgo/test/issue1560.go

index ac897aa33bf217a8637b2352178b0a260f69ea1a..4f49399545ffefc16553523dcf7f4ca22ea22ff9 100644 (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()