mirror of
https://github.com/golang/go
synced 2024-11-21 23:44:39 -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:
parent
5a93fea08e
commit
81a9cc31c4
@ -56,8 +56,12 @@ func wasteCPU() chan struct{} {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func testParallelSleep(t *testing.T) {
|
func testParallelSleep(t *testing.T) {
|
||||||
defer runtime.GOMAXPROCS(runtime.GOMAXPROCS(2))
|
if runtime.GOARCH == "arm" {
|
||||||
defer close(wasteCPU())
|
// 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
|
sleepSec := 1
|
||||||
start := time.Now()
|
start := time.Now()
|
||||||
|
Loading…
Reference in New Issue
Block a user