diff options
| author | Ian Lance Taylor <iant@golang.org> | 2016-03-10 22:01:41 -0800 |
|---|---|---|
| committer | Ian Lance Taylor <iant@golang.org> | 2016-03-11 06:43:01 +0000 |
| commit | b354f914174f971b26ac813236627b7cccaf3382 (patch) | |
| tree | b1c5435ada5565ca8769e38237310e9b406a6f6f /src/runtime/testdata | |
| parent | def9c0b06d4796364cda3c1e40d75bb0fa0ecddf (diff) | |
| download | go-b354f914174f971b26ac813236627b7cccaf3382.tar.xz | |
runtime: limit TestCgoCCodeSIGPROF test to 1 second
Still fails about 20% of the time on my laptop.
Fixes #14766.
Change-Id: I169ab728c6022dceeb91188f5ad466ed6413c062
Reviewed-on: https://go-review.googlesource.com/20590
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/runtime/testdata')
| -rw-r--r-- | src/runtime/testdata/testprogcgo/aprof.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/runtime/testdata/testprogcgo/aprof.go b/src/runtime/testdata/testprogcgo/aprof.go index cf52107a30..b4b71f2861 100644 --- a/src/runtime/testdata/testprogcgo/aprof.go +++ b/src/runtime/testdata/testprogcgo/aprof.go @@ -17,6 +17,7 @@ import ( "bytes" "fmt" "runtime/pprof" + "time" ) func init() { @@ -31,7 +32,13 @@ func CgoCCodeSIGPROF() { go func() { for { <-c + start := time.Now() for i := 0; i < 1e7; i++ { + if i%1000 == 0 { + if time.Since(start) > time.Second { + break + } + } C.GoNop() } c <- true |
